Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broken configuration when using ccmake on Ubuntu #720

Closed
maciekab opened this issue Feb 22, 2013 · 8 comments
Closed

broken configuration when using ccmake on Ubuntu #720

maciekab opened this issue Feb 22, 2013 · 8 comments

Comments

@maciekab
Copy link
Member

On Ubuntu 12.04 using ccmake instead of cmake apparently generates broken configuration that prevents correct compilation of examples.gtcx. The command line options passed to cmake/ccmake are identical and listed below: -DCMAKE_INSTALL_PREFIX=/home/maciek/packages/hpx-gtc -DHWLOC_ROOT=/opt/hwloc/1.6.1 -DBOOST_ROOT=/opt/boost/1.53.0 -DHDF5_ROOT=/opt/hdf5/1.8.10/ -DHDF5_CPP_ROOT=/opt/hdf5/1.8.10/ -DHDF5_FORTRAN_ROOT=/opt/hdf5/1.8.10/ ... The resultant cmake cache files in respective build directories differ as follows:

$ diff build-ccmake/CMakeCache.txt build/CMakeCache.txt 
2c2
< # For build in directory: /home/maciek/src/hpx/build-ccmake

---
> # For build in directory: /home/maciek/src/hpx/build
77,78c77,79
< //No help, variable specified on the command line.
< BOOST_ROOT:UNINITIALIZED=/opt/boost/1.53.0

---
> //The Boost source tree to use (default: BOOST_ROOT or BOOST environmental
> // variable).
> BOOST_ROOT:PATH=/opt/boost/1.53.0
292,293c293,294
< //No help, variable specified on the command line.
< HDF5_CPP_ROOT:UNINITIALIZED=/opt/hdf5/1.8.10/

---
> //HDF5_CPP root directory.
> HDF5_CPP_ROOT:PATH=/opt/hdf5/1.8.10
307,308c308,309
< //No help, variable specified on the command line.
< HDF5_FORTRAN_ROOT:UNINITIALIZED=/opt/hdf5/1.8.10/

---
> //HDF5_FORTRAN root directory.
> HDF5_FORTRAN_ROOT:PATH=/opt/hdf5/1.8.10
322,323c323,324
< //No help, variable specified on the command line.
< HDF5_ROOT:UNINITIALIZED=/opt/hdf5/1.8.10/

---
> //HDF5 root directory.
> HDF5_ROOT:PATH=/opt/hdf5/1.8.10
626c627
< HPX_RPATH:STRING=/home/maciek/packages/hpx-gtc/lib/hpx:/home/maciek/src/hpx/build-ccmake/lib/hpx

---
> HPX_RPATH:STRING=/home/maciek/packages/hpx-gtc/lib/hpx:/home/maciek/src/hpx/build/lib/hpx
690,691c691,692
< //No help, variable specified on the command line.
< HWLOC_ROOT:UNINITIALIZED=/opt/hwloc/1.6.1

---
> //HWLOC root directory.
> HWLOC_ROOT:PATH=/opt/hwloc/1.6.1
764,765c765,766
< //MPI compiler wrapper for Fortran.
< MPI_Fortran_COMPILER:FILEPATH=

---
> //Path to a program.
> MPI_Fortran_COMPILER:FILEPATH=MPI_Fortran_COMPILER-NOTFOUND
767c768
< //MPI compilation flags for Fortran.

---
> //MPI Fortran compilation flags
771c772
< MPI_Fortran_FOUND:BOOL=

---
> MPI_Fortran_FOUND:BOOL=FALSE
773,774c774,775
< //MPI include headers for Fortran.
< MPI_Fortran_INCLUDE_PATH:FILEPATH=

---
> //MPI Fortran include path
> MPI_Fortran_INCLUDE_PATH:STRING=MPI_HEADER_PATH-NOTFOUND
776,777c777,778
< //MPI libraries for Fortran.
< MPI_Fortran_LIBRARIES:STRING=

---
> //MPI Fortran libraries to link against
> MPI_Fortran_LIBRARIES:STRING=MPI_Fortran_LIBRARIES-NOTFOUND
779c780
< //MPI link flags for Fortran.

---
> //MPI Fortran linking flags
1581c1582
< hpx_BINARY_DIR:STATIC=/home/maciek/src/hpx/build-ccmake

---
> hpx_BINARY_DIR:STATIC=/home/maciek/src/hpx/build
1751c1752
< CMAKE_CACHEFILE_DIR:INTERNAL=/home/maciek/src/hpx/build-ccmake

---
> CMAKE_CACHEFILE_DIR:INTERNAL=/home/maciek/src/hpx/build
1797a1799,1800
> //Result of TRY_COMPILE
> CMAKE_DETERMINE_Fortran_ABI_COMPILED:INTERNAL=TRUE
1815a1819
> CMAKE_Fortran_COMPILER_WORKS:INTERNAL=1
2091a2096,2105
> //ADVANCED property for variable: MPI_Fortran_COMPILER
> MPI_Fortran_COMPILER-ADVANCED:INTERNAL=1
> //ADVANCED property for variable: MPI_Fortran_COMPILE_FLAGS
> MPI_Fortran_COMPILE_FLAGS-ADVANCED:INTERNAL=1
> //ADVANCED property for variable: MPI_Fortran_INCLUDE_PATH
> MPI_Fortran_INCLUDE_PATH-ADVANCED:INTERNAL=1
> //ADVANCED property for variable: MPI_Fortran_LIBRARIES
> MPI_Fortran_LIBRARIES-ADVANCED:INTERNAL=1
> //ADVANCED property for variable: MPI_Fortran_LINK_FLAGS
> MPI_Fortran_LINK_FLAGS-ADVANCED:INTERNAL=1

This problem has not been encountered so far on other distributions. Cmake versions tried were 2.8.7 (system installation) and 2.8.10.2 (compiled); both exhibit the same behavior. The resultant compilation error is:

$ make examples.gtcx
[  0%] Built target hpx_serialization
[ 68%] Built target hpx
[ 71%] Built target distributing_factory_component
[ 87%] Built target gtcx_hpx_fortran_lib
[ 90%] Built target iostreams_component
[ 93%] Built target gtcx_hpx_component
[100%] Built target hpx_init
Linking CXX executable ../../bin/gtcx_client
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_flush_i4'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_st_rewind'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_transfer_character_write'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_runtime_error'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_st_write_done'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_transfer_integer'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_st_open'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_st_read'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_random_r8'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_transfer_real'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_transfer_array'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_date_and_time'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_os_error'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_arandom_r8'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_st_inquire'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_st_read_done'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_transfer_array_write'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_st_close'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_system_clock_4'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_st_set_nml_var_dim'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_st_set_nml_var'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_transfer_integer_write'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_random_seed_i4'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_st_write'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_transfer_real_write'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_cshift0_4'
../../lib/hpx/libgtcx_hpx_fortran.so.1.0.0: undefined reference to `_gfortran_runtime_error_at'
collect2: ld returned 1 exit status
make[3]: *** [bin/gtcx_client] Error 1
make[2]: *** [examples/gtcx/CMakeFiles/gtcx_client_exe.dir/all] Error 2
make[1]: *** [examples/CMakeFiles/examples.gtcx.dir/rule] Error 2
make: *** [examples.gtcx] Error 2
@hkaiser
Copy link
Member

hkaiser commented Feb 22, 2013

Maciek, do you think that is caused by our build system? Or could it be a ccmake problem in the first place?

@maciekab
Copy link
Member Author

It's hard to tell. I think reporting it is important, since we wasted inordinate amount of time looking for misconfigured compilation flags, linking scripts, etc., while the workaround (using cmake instead of ccmake) is trivial. It wouldn't be good for some inexperienced user to have to go through all the effort to diagnose this issue. It may be a ccmake problem, it may just as well be an indication that something is still not quite right with HPX configuration macros. Is there a reason for the contents of cmake cache to be so different in both cases?

@hkaiser
Copy link
Member

hkaiser commented Feb 22, 2013

Since I do not understand enough of ccmake and how it invokes cmake underneath, I'm not able to tell where the differences come from (I didn't even know that you could pass variable values to ccmake via its command line). I agree that documenting this problem is important, however I'm not sure if we can do anything about it except for reporting the issue to the cmake/ccmake maintainers.

Experience shows that any change to a cmake variable might take proper effect only after the cache is regenerated from scratch. I'll go ahead and add something to that effect to our build system docs.

@sithhell
Copy link
Member

One of the major problems with the way HPX uses CMake currently is the overly abuse of cache variables. Most variables flagged as cacheable really don't belong into the cache. I am not sure if this is related to the issue at hand.

@hkaiser
Copy link
Member

hkaiser commented Feb 24, 2013

Thomas I believe what you describe is unrelated. The problem described here is just the result of a bug in ccmake as both commands (as described above) have been issued on a fresh build directory (is that so, Maciek?). For instance, ccmake fails to detect the Fortran compiler:

< # For build in directory: /home/maciek/src/hpx/build-ccmake
< MPI_Fortran_FOUND:BOOL=
---
> # For build in directory: /home/maciek/src/hpx/build
> MPI_Fortran_FOUND:BOOL=FALSE

while cmake detects that it is not available.

@maciekab
Copy link
Member Author

Hartmut -- that's correct. In both cases the configuration was done in completely empty build directories. After dealing with cmake for a while, this and wiping out the prefix directory before the installation becomes your second nature.

@brycelelbach
Copy link
Member

I believe that Thomas Heller's statement is absolutely correct.

@sithhell
Copy link
Member

sithhell commented Sep 3, 2014

This should be fixed by ecdb034. Please reopen if the problem still persists.

@sithhell sithhell closed this as completed Sep 3, 2014
@hkaiser hkaiser modified the milestones: 0.9.10, 1.0.0 Feb 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants