GlobalArrays / ga

Partitioned Global Address Space (PGAS) library for distributed arrays
http://hpc.pnl.gov/globalarrays/
Other
97 stars 38 forks source link

CMake build fails if Fortran is enabled but ScaLAPACK is not found #174

Closed e-kwsm closed 3 years ago

e-kwsm commented 3 years ago

GA: 258546972deca14bf541be8b69d8becfdeed39ff

I try adding -DENABLE_FORTRAN=YES flag during CMake configuration to avoid #158, but build fails:

$ mkdir build
$ cd build
$ cmake -DENABLE_FORTRAN=YES ..
$ make
[  0%] Built target GenerateConfigFH
[ 21%] Built target linalg
[ 31%] Built target ga_src
[ 33%] Built target armci_comex
[ 35%] Built target ma
[ 35%] Built target eaf
[ 36%] Built target sf
[ 39%] Built target dra
[ 40%] Built target elio
[ 41%] Built target gaf2c
[ 42%] Built target ga
[ 44%] Built target armci
[ 45%] Built target comex
[ 45%] Built target testf.x
[ 45%] Built target test-coalesce.x
[ 46%] Built target test-inquire.x
[ 47%] Linking Fortran executable types-test.x
/usr/bin/ld: ../../libga.a(ga_diag_seqc.c.o): in function `pnga_diag_seq':
ga_diag_seqc.c:(.text+0x2c): undefined reference to `gai_diag_seq_'
/usr/bin/ld: ../../libga.a(ga_diag_seqc.c.o): in function `pnga_diag_std_seq':
ga_diag_seqc.c:(.text+0x5a): undefined reference to `gai_diag_std_seq_'
collect2: error: ld returned 1 exit status
make[2]: *** [global/testing/CMakeFiles/types-test.x.dir/build.make:112: global/testing/types-test.x] Error 1
make[1]: *** [CMakeFiles/Makefile2:923: global/testing/CMakeFiles/types-test.x.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Definitions of gai_diag_seq and gai_diag_std_seq are

which is called by

respectively.

This issue is because the fortran file is compiled only when ScaLAPACK (and LAPACK) is available but ENABLE_F77 macro is defined independently.

https://github.com/GlobalArrays/ga/blob/258546972deca14bf541be8b69d8becfdeed39ff/global/src/CMakeLists.txt#L48-L57

e-kwsm commented 3 years ago

Fixed in the develop branch.