dylan-jayatilaka / tonto

for Quantum Crystallography
dylan-jayatilaka.net/tonto
GNU General Public License v2.0
26 stars 5 forks source link

<< compilation error: #error: can't find include file: sbf_dataset_constructor.F90 >> #17

Closed icamps closed 7 years ago

icamps commented 8 years ago

Hello,

I am trying to compile TONTO in my Linux box. To do that I did the following:

After running "make -j", I am getting the following error:

sbf_dataset_constructors.F90(8): #error: can't find include file: sbf_dataset_constructor.F90
.... (repeat exactly the same but in different lines numbers)
sbf_get_datasets.F90(10): #error: can't find include file: sbf_get_dataset.F90
.... (repeat exactly the same but in different lines numbers)
make[2]: *** [external/sbf/include/CMakeFiles/sbf_fortran.dir/build.make:63: external/sbf/include/CMakeFiles/sbf_fortran.dir/sbf.F90.o] Error 128
make[1]: *** [CMakeFiles/Makefile2:497: external/sbf/include/CMakeFiles/sbf_fortran.dir/all] Error 2
make: *** [Makefile:161: all] Error 2

My system is OpenSUSE Tumbleweed (updated) and the Intel toolchains, i.e., ifort + imkl + impi.

Regards,

Camps

peterspackman commented 8 years ago

Hi there,

Sorry it's not working!

I don't think we've properly tested MPI builds since SBF was added. Something of an oversight. It's a bit late here, so I'll give it a try to investigate tomorrow morning and get back to you.

The error indicates that the include files are not being located during the build, but that doesn't make much sense to me right now so I'll need to investigate.

I'll get back to you tomorrow.

Cheers, Peter

peterspackman commented 8 years ago

Can you check for me if git submodule update fixes the problem? I just tried compiling with MPI and it's working on Ubuntu for me.

If that doesn't work would you be able to tell me the contents of the external/sbf folder in the tonto project directory? If it all looks good then it's likely a problem with using the intel compilers. This, in all likelihood, will not compile. I don't think tonto runs correctly when compiled with ifort (though I don't have access to the latest toolchain). I think this is to do with some compiler bugs and/or code generation differences in the compiler. Dylan went to a bit of effort earlier this year to try and get it working but gave up in the end I think.

While the intel compilers tend to produce faster code (esp. with autoparallelization) from what I remember, the differences for tonto are likely to be minimal. My advice is (if the above didn't work), try it with gfortran/open-mpi.

I'm fairly sure tonto is working correctly with both gfortran and the NAG compilers (PGI I think fails to compile due to some modern fortran stuff). The only differences have always been numerical.

I also haven't tested SBF with ifort (again because I don't have the compiler), and it abuses some fairly recent Fortran 2008 stuff so it might not work with their compilers, depending on their support (e.g. it doesn't work with old versions of gfortran, at least earlier than 4.9 or so I think). this could be the source of the cryptic error message about not finding some source files, or that our ifort compiler flags are not working correctly.

icamps commented 8 years ago

Hello Peter,

Thank you very much for your emails.

As here are 2am now, I will try it in a few hours and send you a feedback.

On Fri, Nov 11, 2016, 01:51 Peter Spackman notifications@github.com wrote:

Can you check for me if git submodule update fixes the problem? I just tried compiling with MPI and it's working on Ubuntu for me.

If that doesn't work would you be able to tell me the contents of the external/sbf folder in the tonto project directory? If it all looks good then it's likely a problem with using the intel compilers. This, in all likelihood, will not compile. I don't think tonto runs correctly when compiled with ifort (though I don't have access to the latest toolchain). I think this is to do with some compiler bugs and/or code generation differences in the compiler. Dylan went to a bit of effort earlier this year to try and get it working but gave up in the end I think.

While the intel compilers tend to produce faster code (esp. with autoparallelization) from what I remember, the differences for tonto are likely to be minimal. My advice is (if the above didn't work), try it with gfortran/open-mpi.

I'm fairly sure tonto is working correctly with both gfortran and the NAG compilers (PGI I think fails to compile due to some modern fortran stuff). The only differences have always been numerical.

I also haven't tested SBF with ifort (again because I don't have the compiler), and it abuses some fairly recent Fortran 2008 stuff so it might not work with their compilers, depending on their support (e.g. it doesn't work with old versions of gfortran, at least earlier than 4.9 or so I think). this could be the source of the cryptic error message about not finding some source files, or that our ifort compiler flags are not working correctly.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dylan-jayatilaka/tonto/issues/17#issuecomment-259874948, or mute the thread https://github.com/notifications/unsubscribe-auth/AMqLUqd01H_NfSi7PBv_4Gb22DW4P6O1ks5q8-Y9gaJpZM4KupZI .

[]`s

Camps

icamps commented 8 years ago

Hello @peterspackman,

I tried git submodule update but the problem continues.

The content of external/sbf is:

external/sbf/:
CMakeFiles
cmake_install.cmake
CTestTestfile.cmake
include
Makefile
tests

external/sbf/CMakeFiles:
CMakeDirectoryInformation.cmake
progress.marks

external/sbf/include:
CMakeFiles
cmake_install.cmake
CTestTestfile.cmake
Makefile

external/sbf/include/CMakeFiles:
CMakeDirectoryInformation.cmake
progress.marks
sbf_fortran.dir

external/sbf/include/CMakeFiles/sbf_fortran.dir:
build.make
cmake_clean.cmake
cmake_clean_Fortran.cmake
cmake_clean_target.cmake
DependInfo.cmake
depend.internal
depend.make
flags.make
fortran.internal
link.txt
progress.make

external/sbf/tests:
CMakeFiles
cmake_install.cmake
CTestTestfile.cmake
Makefile

external/sbf/tests/CMakeFiles:
basic-c.dir
basic-cpp.dir
basic_fortran.dir
CMakeDirectoryInformation.cmake
progress.marks
write_read_file-c.dir
write_read_file-cpp.dir
write_read_file_fortran.dir

external/sbf/tests/CMakeFiles/basic-c.dir:
build.make
cmake_clean.cmake
DependInfo.cmake
depend.make
flags.make
link.txt
progress.make

external/sbf/tests/CMakeFiles/basic-cpp.dir:
build.make
cmake_clean.cmake
DependInfo.cmake
depend.make
flags.make
link.txt
progress.make

external/sbf/tests/CMakeFiles/basic_fortran.dir:
build.make
cmake_clean.cmake
DependInfo.cmake
depend.make
flags.make
link.txt
progress.make

external/sbf/tests/CMakeFiles/write_read_file-c.dir:
build.make
cmake_clean.cmake
DependInfo.cmake
depend.make
flags.make
link.txt
progress.make

external/sbf/tests/CMakeFiles/write_read_file-cpp.dir:
build.make
cmake_clean.cmake
DependInfo.cmake
depend.make
flags.make
link.txt
progress.make

external/sbf/tests/CMakeFiles/write_read_file_fortran.dir:
build.make
cmake_clean.cmake
DependInfo.cmake
depend.make
flags.make
link.txt
progress.make
external/sbf/:
CMakeLists.txt
include
meson.build
README.md
scripts
tests

external/sbf/include:
CMakeLists.txt
meson.build
sbf
sbf.F90
sbf.h
sbf.hpp

external/sbf/include/sbf:
dataset.hpp
sbf_dataset_constructor.F90
sbf_dataset_constructors.F90
sbf_get_dataset.F90
sbf_get_datasets.F90
types.hpp

external/sbf/scripts:
cleanup-format
generate_fortran_includes.py

external/sbf/tests:
basic.c
basic.cpp
basic.F90
CMakeLists.txt
meson.build
unit_test.h
write_read_file.c
write_read_file.cpp
write_read_file.F90
icamps commented 8 years ago

@peterspackman An update:

I compiled successfully with the default system compilers (gfortran and gnu CC).

I will try to add open-mpi.

peterspackman commented 8 years ago

Glad to hear it. And yeah, that means as I'd expected there's some issue with the flags for the intel compiler. I'll have to get a copy and test it out sometime.

In the meantime, using open-mpi should be pretty straightforward. For me the cmake flags were basically as you'd used -DCMAKE_Fortran_COMPILER=mpifort -DMPI=1 etc.

peterspackman commented 7 years ago

This should be resolved as of this commit in the SBF repository. There was a problem with not explicitly specifying the include directory.