Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Error LNK1104 in compiling an opensource software with Intel Fortran Compiler

Gao__Wu
Novice
1,557 Views

Hi all,

I would like to compile an opensource software (which is called “Cantera”) with Intel Fortran compilers to get its Fortran interface, but I encountered a problem that the Cantera's developers did not meet.

Here's my basic set up and installation directories:

  • Windows 10 64-bit
  • Visual Studio 2010 (C:\Program Files (x86)\Microsoft Visual Studio 10.0)
  • Intel Parallel Studio XE 2016 (C:\Program Files (x86)\IntelSWTools)
  • Python 3.7.4 (C:\Python37)
  • SCons 3.1.1 (C:\Python37\Lib\site-packages\scons)
  • Boost 1.70.0 (C:\Users\Wu\boost)
  • Cantera 2.4.0 (source codes that need to be compiled; C:\Users\Wu\cantera)

The Intel Fortran compiler “ifort.exe” has been added to the Path of the system Environment Variables by ‘C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.4.246\windows\bin\intel64’ (it also can be written as FORTRAN = ‘C:\\PROGRA~2\\IntelSWTools\\compilers_and_libraries_2016.4.246\\windows\\bin\\intel64\\ifort.exe’ in a cantera.conf file which scons can read), then ‘scons build’ command was input in the Windows PowerShell to run the compiling. However, compiling halts due to following error:

PS C:\Users\Wu\cantera> scons build

scons: Reading SConscript files ...

INFO: SCons is using the following Python interpreter: C:\Python37\python.exe

INFO: Compiling with MSVC 10.0

INFO: Compiling for architecture: amd64

INFO: Compiling using the following toolchain(s): ['default']

Configuration variables read from 'cantera.conf' and command line:

    msvc_version = '10.0'

    f90_interface = 'y'

    boost_inc_dir = 'C:\\Users\\Wu\\boost\\boost_1_70_0'

 

Checking for C++ header file cmath... yes

Checking for C++ header file fmt/ostream.h... no

INFO: Using private installation of fmt library.

INFO: Could not find version of fmt

Checking for C++ header file yaml-cpp/yaml.h... no

INFO: Using private installation of yaml-cpp library.

Checking for C++ header file gtest/gtest.h... no

Checking for C++ header file gmock/gmock.h... no

INFO: Using Googletest from Git submodule

Checking for C++ header file Eigen/Dense... no

INFO: Using private installation of Eigen.

INFO: Found Eigen version 3.3.4

Checking whether __GLIBCXX__ is declared... no

Checking whether _LIBCPP_VERSION is declared... no

Checking whether __clang__ is declared... no

INFO: Found Boost version 1.70

Checking whether boost::core::demangle is declared... yes

Checking for CVodeCreate(CV_BDF, CV_NEWTON) in C++ library sundials_cvodes... no

Checking for CVodeCreate(CV_BDF) in C++ library sundials_cvodes... no

Checking for double x; log(x) in C library None... yes

INFO: Using private installation of Sundials version 3.1.

WARNING: Unable to use 'ifort' to compile the Fortran interface. See config.log for details.

ERROR: Couldn't find a suitable Fortran compiler to build the Fortran 90 interface.

 

In the config.log, this message can be found:

.sconf_temp\conftest_16.f90 <-

  |

  |program main

  |   write(*,'(a)') 'Hello, world!'

  |end program main

  |   

ifort -o .sconf_temp\conftest_16.obj -c -O3 .sconf_temp\conftest_16.f90

Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.4.246 Build 20160811

Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

 

link /nologo /DEBUG /OUT:.sconf_temp\conftest_16.exe .sconf_temp\conftest_16.obj

LINK : fatal error LNK1104: cannot open file “ifconsol.lib”

 

I’ve tested the Intel Fortran compiler by adding this “hello, world” program (as in conftest_16.f90) to a fold called “testf” on the desktop and compiled it with the Intel Compiler windows prompt, a corresponding .obj file can be successfully generated with no such LINK error.

C:\Program Files (x86)\IntelSWTools>cd C:\Users\Wu\Desktop\testf

C:\Users\Wu\Desktop\testf>ifort /c conftest_16.f90

Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.4.246 Build 20160811

Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

 

Is there some setup I am missing so that this compiling process can’t proceed? Cantera’s developers have successful experience compiling the Cantera Fortran interface using Intel compilers on Linux but no such experience on Windows. I have been stuck with this problem for a couple of weeks. Any help and advice are much appreciated.

 

Kind regards,

Wu

0 Kudos
1 Reply
Gao__Wu
Novice
1,557 Views

Hi all,

This problem has been solved.

The solution is as follows:

Open the Visual Studio 2010 x64 Command Prompt from the Start menu, and run the Intel compilervars.bat file first. For example, like this:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.4.246\windows\bin\compilervars.bat" intel64

In the same prompt then change the directory to wherever the Cantera source is and then run scons build. For example, like this:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>cd C:\Users\cantera

C:\Users\cantera>scons build

Kind regards,

Wu

 

0 Kudos
Reply