Compilation problems - cannot open source file "bits/c++config.h"

Problems with Dalton installation? Find answers or ask for help here
Post Reply
Ricardo_R_JR
Posts: 2
Joined: 20 Jun 2018, 18:31
First name(s): Ricardo
Last name(s): Oliveira
Affiliation: Federal University of RIo de Janeiro
Country: Brazil

Compilation problems - cannot open source file "bits/c++config.h"

Post by Ricardo_R_JR » 20 Jun 2018, 23:54

I am trying to install LSDalton using this configuration:

./setup --fc=ifort --cc=icc --cxx=icpc --mkl=parallel

The output of setup script is:

++++++++++++++++++++++++++++++++++++++++++++++++++++
Configuring system: Ubuntu
FC=ifort CC=icc CXX=icpc cmake -DENABLE_MPI=OFF -DENABLE_SGI_MPT=OFF -DENABLE_OMP=OFF -DENABLE_64BIT_INTEGERS=OFF -DENABLE_GPU=OFF -DENABLE_CUBLAS=OFF -DENABLE_CSR=OFF -DENABLE_SCALASCA=OFF -DENABLE_VAMPIRTRACE=OFF -DENABLE_TIMINGS=OFF -DENABLE_STATIC_LINKING=OFF -DENABLE_SCALAPACK=OFF -DENABLE_AUTO_BLAS=ON -DENABLE_AUTO_LAPACK=ON -DMKL_FLAG="-mkl=parallel" -DENABLE_AUTO_BLAS=OFF -DENABLE_AUTO_LAPACK=OFF -DCMAKE_ARGS="--no-warn-unused-cli" -DCMAKE_BUILD_TYPE=release /home/ricardo/Programas/lsdalton

-- User set explicit MKL flag which is passed to the compiler and linker: -mkl=parallel
-- This disables math detection and builtin math libraries
-- Setting -DHAVE_MKL_BLAS and -DHAVE_MKL_LAPACK
-- DEC deactivated due to missing POINTER RESHAPE features
-- TENSORS (ScaTeLib) deactivated due to missing POINTER RESHAPE features
-- GIT_BRANCH : master
-- System : Linux
-- Processor type : x86_64
-- Fortran compiler flags: -fpp -assume byterecl -DVAR_IFORT -mkl=parallel -O3 -ip
-- C compiler flags : -g -wd981 -wd279 -wd383 -vec-report0 -wd1572 -wd1777 -restrict -DRESTRICT=restrict -mkl=parallel -O3 -ip
-- Libraries : -mkl=parallel
-- Definitions : SYS_LINUX;SYS_UNIX;VAR_IFORT;COMPILER_UNDERSTANDS_FORTRAN_2003;HAVE_MKL_BLAS;HAVE_MKL_LAPACK;VAR_MFDS;_FILE_OFFSET_BITS=64;IMPLICIT_NONE;BINARY_INFO_AVAILABLE;INSTALL_BASDIR="/home/ricardo/Programas/lsdalton/build/basis";VAR_RSP;INSTALL_WRKMEM=64000000;INSTALL_MMWORK=1;VAR_XCFUN
CMake Warning:
Manually-specified variables were not used by the project:

CMAKE_ARGS

-- The Fortran compiler identification is Intel 12.1.0.20120612
-- The C compiler identification is Intel 12.1.0.20120612
-- The CXX compiler identification is Intel 12.1.0.20120612
-- Check for working Fortran compiler: /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/ifort
-- Check for working Fortran compiler: /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/ifort -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/ifort supports Fortran 90
-- Checking whether /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/ifort supports Fortran 90 -- yes
-- Check for working C compiler: /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/icc
-- Check for working C compiler: /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/icc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/icpc
-- Check for working CXX compiler: /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/icpc -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Performing Test COMPILER_UNDERSTANDS_FORTRAN03
-- Performing Test COMPILER_UNDERSTANDS_FORTRAN03 - Success
-- Performing Test PTR_RESHAPE_WORKS
-- Performing Test PTR_RESHAPE_WORKS - Failed
-- Found Git: /usr/bin/git
-- Polarizable Continuum Model via PCMSolver DISABLED
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ricardo/Programas/lsdalton/build

configure step is done
now you need to compile the sources:
$ cd build
$ make
++++++++++++++++++++++++++++++++++++++++++++++++++++

When i try to compile with make command, the output is:

++++++++++++++++++++++++++++++++++++++++++++++++++++
-- This disables math detection and builtin math libraries
-- Setting -DHAVE_MKL_BLAS and -DHAVE_MKL_LAPACK
-- DEC deactivated due to missing POINTER RESHAPE features
-- TENSORS (ScaTeLib) deactivated due to missing POINTER RESHAPE features
-- GIT_BRANCH : master
-- Polarizable Continuum Model via PCMSolver DISABLED
-- System : Linux
-- Processor type : x86_64
-- Fortran compiler flags: -fpp -assume byterecl -DVAR_IFORT -mkl=parallel -O3 -ip
-- C compiler flags : -g -wd981 -wd279 -wd383 -vec-report0 -wd1572 -wd1777 -restrict -DRESTRICT=restrict -mkl=parallel -O3 -ip
-- Libraries : -mkl=parallel
-- Definitions : SYS_LINUX;SYS_UNIX;VAR_IFORT;COMPILER_UNDERSTANDS_FORTRAN_2003;HAVE_MKL_BLAS;HAVE_MKL_LAPACK;VAR_MFDS;_FILE_OFFSET_BITS=64;IMPLICIT_NONE;BINARY_INFO_AVAILABLE;INSTALL_BASDIR="/home/ricardo/Programas/lsdalton/build/basis";VAR_RSP;INSTALL_WRKMEM=64000000;INSTALL_MMWORK=1;VAR_XCFUN
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ricardo/Programas/lsdalton/build
Scanning dependencies of target lsutillib_precision
[ 0%] Building Fortran object CMakeFiles/lsutillib_precision.dir/src/lsutil/ls_precision.F90.o
[ 0%] Building Fortran object CMakeFiles/lsutillib_precision.dir/src/lsutil/lsmpi_mod.F90.o
[ 0%] Linking Fortran static library lib/liblsutillib_precision.a
[ 0%] Built target lsutillib_precision
Scanning dependencies of target check_external_timestamp_xcfun
[ 0%] Built target check_external_timestamp_xcfun
Scanning dependencies of target xcfun
[ 1%] Creating directories for 'xcfun'
[ 1%] Performing download step for 'xcfun'

[ 1%] No patch step for 'xcfun'
[ 1%] No update step for 'xcfun'
[ 2%] Performing configure step for 'xcfun'
-- The C compiler identification is Intel 12.1.0.20120612
-- The CXX compiler identification is Intel 12.1.0.20120612
-- Check for working C compiler: /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/icc
-- Check for working C compiler: /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/icc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/icpc
-- Check for working CXX compiler: /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/icpc -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- The Fortran compiler identification is Intel 12.1.0.20120612
-- Check for working Fortran compiler: /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/ifort
-- Check for working Fortran compiler: /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/ifort -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/ifort supports Fortran 90
-- Checking whether /opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/ifort supports Fortran 90 -- yes
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ricardo/Programas/lsdalton/build/external/xcfun-build
[ 2%] Performing build step for 'xcfun'
Scanning dependencies of target xcfun
[ 1%] Building CXX object CMakeFiles/xcfun.dir/src/xcint.cpp.o
/usr/include/c++/5/cstdio(41): catastrophic error: cannot open source file "bits/c++config.h"
#include <bits/c++config.h>
^

CMakeFiles/xcfun.dir/build.make:62: recipe for target 'CMakeFiles/xcfun.dir/src/xcint.cpp.o' failed
make[5]: *** [CMakeFiles/xcfun.dir/src/xcint.cpp.o] Error 4
CMakeFiles/Makefile2:323: recipe for target 'CMakeFiles/xcfun.dir/all' failed
make[4]: *** [CMakeFiles/xcfun.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make[3]: *** [all] Error 2
CMakeFiles/xcfun.dir/build.make:110: recipe for target 'external/xcfun-stamp/xcfun-build' failed
make[2]: *** [external/xcfun-stamp/xcfun-build] Error 2
CMakeFiles/Makefile2:489: recipe for target 'CMakeFiles/xcfun.dir/all' failed
make[1]: *** [CMakeFiles/xcfun.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
++++++++++++++++++++++++++++++++++++++++++++++++++++

It seems to me that the problem is the path to include files. The automatic path "/usr/include/c++/5/bits" is wrong, the real path is "/usr/include/x86_64-linux-gnu/c++/5/bits/". If the makefile does not exist how do I fix it?

Thanks.

User avatar
magnus
Posts: 418
Joined: 27 Jun 2013, 16:32
First name(s): Jógvan Magnus
Middle name(s): Haugaard
Last name(s): Olsen
Affiliation: Hylleraas Centre, UiT The Arctic University of Norway
Country: Norway

Re: Compilation problems - cannot open source file "bits/c++config.h"

Post by magnus » 22 Jun 2018, 08:13

I'm not sure if it will work but you can pass extra flags as follows:

Code: Select all

./setup --fc=ifort --cc=icc --cxx=icpc --mkl=parallel --extra-cxx-flags=-I/usr/include/x86_64-linux-gnu/c++/5/bits

Ricardo_R_JR
Posts: 2
Joined: 20 Jun 2018, 18:31
First name(s): Ricardo
Last name(s): Oliveira
Affiliation: Federal University of RIo de Janeiro
Country: Brazil

Re: Compilation problems - cannot open source file "bits/c++config.h"

Post by Ricardo_R_JR » 22 Jun 2018, 22:33

magnus wrote:
22 Jun 2018, 08:13
I'm not sure if it will work but you can pass extra flags as follows:

Code: Select all

./setup --fc=ifort --cc=icc --cxx=icpc --mkl=parallel --extra-cxx-flags=-I/usr/include/x86_64-linux-gnu/c++/5/bits
Don't worked but thanks anyway.

taylor
Posts: 525
Joined: 15 Oct 2013, 05:37
First name(s): Peter
Middle name(s): Robert
Last name(s): Taylor
Affiliation: Tianjin University
Country: China

Re: Compilation problems - cannot open source file "bits/c++config.h"

Post by taylor » 29 Jun 2018, 04:37

When you post outputs, could you please upload the files, or perhaps format them as code fragments? In a long posting of the form
<some output>
Interspersed user comment
<some more output>
it is easy to miss the comments!

It looks like some compiler/version mismatch(es) here. The c++configs.h file is a very low-level C++ header file that is included by higher-level C++ include files. It contains various definitions related to system libraries like GLIBC. I think its location is determined by the installation of the gcc compiler set (gcc, g++, gfortran) and gcc at least is required by any Linux installation. There are versions out to 7.x, although many sites/distros will be on older versions. Depending on the version, the include files may be somewhere under /usr/include/c++/<version_number>/... or they may have a more elaborate name for the hierarchy such as under /usr/include/x86_64-linux-gnu/c++/<version_number>/...

You are compiling with a (very old) version of the Intel compiler. To my knowledge ifort/icc/icpc relies on finding some versions of the "standard" include files --- Intel does not supply cstdlib.h, for example --- that are needed to build most codes. I suspect that your Intel compiler, either during installation or possibly hard-wired, is set to look for include files in the wrong place(s). I do not think it is possible, other than some fairly elaborate work setting include paths, to get around this in a straightforward way.

One test of this hypothesis would be to build using the GNU compiler suite (gfortran/gcc/g++) and not use the Intel compilers. If this builds successfully your problem is with the Intel compiler, which as I mentioned is very out-of-date. If you can install a more recent Intel compiler suite you may have more luck. Alternatively, it is possible with recent (since about version 2013 or 2014, I think) to download, free, the Intel MKL library suite for academic use, and to link with it against code compiled with the GNU compilers. Although the Intel compilers typically generate better-optimized code than the GNU compilers, if you are making heavy use of matrix routines and parallelism, as LSDalton does, the optimization of the user code is relatively less important because much of the computational work uses the libraries, and you will not do better than the MKL routines.

In summary, these are the suggestions:
1) Install a later version of the Intel compiler and see if it works (I can attest to the 2015 compiler).
2) Compile with the GNU compilers and see at least if the build succeeds.
3) Download and install the free MKL libraries, and compile with the GNU compilers but link against MKL. This can be done with appropriate options to the setup command, as documented there.

Good luck!

Best regards
Pete

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests