Closed psakievich closed 3 years ago
@psakievich is this a CUDA/HIP build, or pure CPU build. @aprokop had noticed a similar issue in #47 and the solution there was to set the Fortran compiler to mpif90
interesting. This is just pure cpu right now. Gonna try GPU soon so I will update on how that does if I don't find the solution. I'm trying to chase down through the CMakeFiles right now to see if I can find where this gets injected.
This is not something injected by Tioga CMake, it is coming from a combination of MPI and PThread find package rules.
@psakievich, I had the same problem building tioga (exawind branch) for nalu-wind using gcc 8.4.0 on ppc64le. However, tioga on the master branch builds successfully. So maybe there is a hint there.
Thanks @svdavidson. I'm not sure what the differences are between the two branches. I'll have to look at them closer. I'm just starting to look at tioga for the first time. I ran into another build error with ifort
this morning. If I revert the last commit on the exawind
branch it builds fine. I haven't had a chance to look too closely at what is causing this yet.
3 errors found in build log:
133 [ 72%] Building Fortran object driver/CMakeFiles/poisson_mms.exe.dir/poisson_mms.f90.o
134 cd /projects/wind/spack-manager/spack/var/spack/stage/psakiev/spack-stage-tioga-develop-ihz7xycwe5psq2mao5z2pjrfu2cjnhss/spack-build-ihz7xyc/driver && /projects/wind/spack-manager/sp
ack/lib/spack/env/intel/ifort -DTIOGA_HAS_NODEGID -I/opt/openmpi/4.0/intel/include -I/opt/openmpi/4.0/intel/lib -I/projects/wind/spack-manager/spack/var/spack/stage/psakiev/spack-sta
ge-tioga-develop-ihz7xycwe5psq2mao5z2pjrfu2cjnhss/spack-src/src -r8 -double_size 128 -O3 -fPIE -c /projects/wind/spack-manager/spack/var/spack/stage/psakiev/spack-stage-tioga-develop
-ihz7xycwe5psq2mao5z2pjrfu2cjnhss/spack-src/driver/poisson_mms.f90 -o CMakeFiles/poisson_mms.exe.dir/poisson_mms.f90.o
135 [ 74%] Linking CXX executable poisson_mms.exe
136 cd /projects/wind/spack-manager/spack/var/spack/stage/psakiev/spack-stage-tioga-develop-ihz7xycwe5psq2mao5z2pjrfu2cjnhss/spack-build-ihz7xyc/driver && /projects/wind/spack-manager/sp
ack/opt/spack/linux-rhel7-sandybridge/intel-19.0.3.199/cmake-3.20.3-uno43e5pjqawx232xmxscgo5mpjervrw/bin/cmake -E cmake_link_script CMakeFiles/poisson_mms.exe.dir/link.txt --verbose=
1
137 /projects/wind/spack-manager/spack/lib/spack/env/intel/icpc -O3 -DNDEBUG CMakeFiles/poisson_mms.exe.dir/poisson_mms.f90.o -o poisson_mms.exe -Wl,-rpath,/opt/openmpi/4.0/intel/lib:::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: libtiogadriver.a ../src/libtioga.a /opt/openmpi/4.0/intel/lib/libmpi_usempif08.so /opt/ope
nmpi/4.0/intel/lib/libmpi_usempi_ignore_tkr.so /opt/openmpi/4.0/intel/lib/libmpi_mpifh.so /opt/openmpi/4.0/intel/lib/libmpi.so -ldl -lifport -lifcoremt -lpthread
138 /lib/../lib64/crt1.o: In function `_start':
>> 139 (.text+0x20): undefined reference to `main'
>> 140 make[2]: *** [driver/CMakeFiles/poisson_mms.exe.dir/build.make:105: driver/poisson_mms.exe] Error 1
141 make[2]: Leaving directory '/projects/wind/spack-manager/spack/var/spack/stage/psakiev/spack-stage-tioga-develop-ihz7xycwe5psq2mao5z2pjrfu2cjnhss/spack-build-ihz7xyc'
>> 142 make[1]: *** [CMakeFiles/Makefile2:172: driver/CMakeFiles/poisson_mms.exe.dir/all] Error 2
143 make[1]: Leaving directory '/projects/wind/spack-manager/spack/var/spack/stage/psakiev/spack-stage-tioga-develop-ihz7xycwe5psq2mao5z2pjrfu2cjnhss/spack-build-ihz7xyc'
144 make: *** [Makefile:139: all] Error 2
Hi @psakievich, I did some more digging and found the problem. Two of the tioga CMake files add the MPI_Fortran_COMPILE_FLAGS to the target_compile_definitions instead of target_compile_options which causes the command line option -D-pthread instead of just -pthread. I'll try creating a PR to apply the changes.
@svdavidson thanks so much. While you're at it could you also add the -nofor-main
flag. I believe that is the cause of the second compiler issue I posted here for intel. https://software.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/compiler-reference/compiler-options/compiler-option-details/linking-or-linker-options/nofor-main.html (Thanks to @jrood-nrel)
Sorry @psakievich, I already created pull request #55 before I saw your comment.
@svdavidson that's okay. If you don't want to add it to #55 then I can open a separate PR. Either way works for me. That was a great CMake find BTW.
@psakievich, I put the #55 changes into the master branch, so the changes will need to be merged back into the exawind branch. Is that something you do on a regular basis, or should I go ahead and apply them to the exawind branch also?
@svdavidson either way works for me. I don't regularly update tioga but I also still need to take care of the intel FORTRAN issue so I can put in a PR when I fix that and include a cherry-pick of your commit.
@psakievich - the spack build of nalu-wind with the exawind branch of tioga works now. I believe this issue can be closed. Thanks!
I'm trying to build tioga for nalu-wind. However, I'm getting the following error when I try to build with gcc 7:
pretty sure the issue is the flag
-D-pthread
being fed to the fortran compiler. I can't seem to track down where this flag is being created. So far I've only seen this on rhel7 and gcc7. I don't see this issue when I build on mac-os with gcc 8., but the-D-pthread
flag is missing in that build. Those are the only two complier combinations I've tested this on so far.