Skip to content

Commit 56aa979

Browse files
committed
Fix problem with missed mod files in parallel LAPACK build
1 parent dae4c5a commit 56aa979

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

SRC/CMakeLists.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# This is the makefile to create a library for LAPACK.
33
# The files are organized as follows:
44

5+
# ALLMOD -- Part of ALLAUX
56
# ALLAUX -- Auxiliary routines called from all precisions
67
# SCLAUX -- Auxiliary routines called from single precision
78
# DZLAUX -- Auxiliary routines called from double precision
@@ -35,13 +36,14 @@
3536
#
3637
#######################################################################
3738

39+
set(ALLMOD la_xisnan.F90 la_constants.f90)
40+
3841
set(ALLAUX ilaenv.f ilaenv2stage.f ieeeck.f lsamen.f iparmq.f iparam2stage.F
39-
ilaprec.f ilatrans.f ilauplo.f iladiag.f chla_transtype.f la_xisnan.F90
42+
ilaprec.f ilatrans.f ilauplo.f iladiag.f chla_transtype.f
4043
../INSTALL/ilaver.f ../INSTALL/lsame.f xerbla.f xerbla_array.f
4144
../INSTALL/slamch.f)
4245

4346
set(SCLAUX
44-
la_constants.f90
4547
sbdsvdx.f sbdsdc.f
4648
sbdsqr.f sdisna.f slabad.f slacpy.f sladiv.f slae2.f slaebz.f
4749
slaed0.f slaed1.f slaed2.f slaed3.f slaed4.f slaed5.f slaed6.f
@@ -60,7 +62,6 @@ set(SCLAUX
6062
${SECOND_SRC})
6163

6264
set(DZLAUX
63-
la_constants.f90
6465
dbdsdc.f dbdsvdx.f
6566
dbdsqr.f ddisna.f
6667
disnan.f
@@ -516,7 +517,17 @@ if(BUILD_COMPLEX16)
516517
endif()
517518
list(REMOVE_DUPLICATES SOURCES)
518519

520+
# Use special target for MOD files to guarantee they are built before
521+
# any other files that depend on them
522+
add_library(mod_files OBJECT ${ALLMOD})
523+
set_target_properties(
524+
mod_files PROPERTIES
525+
POSITION_INDEPENDENT_CODE ON
526+
Fortran_PREPROCESS ON
527+
)
528+
519529
add_library(${LAPACKLIB}_obj OBJECT ${SOURCES})
530+
target_link_libraries(${LAPACKLIB}_obj mod_files)
520531
set_target_properties(
521532
${LAPACKLIB}_obj PROPERTIES
522533
POSITION_INDEPENDENT_CODE ON
@@ -530,6 +541,7 @@ if(BUILD_INDEX64_EXT_API)
530541
list(REMOVE_ITEM SOURCES_64 ${SECOND_SRC})
531542
list(REMOVE_ITEM SOURCES_64 ${DSECOND_SRC})
532543
add_library(${LAPACKLIB}_64_obj OBJECT ${SOURCES_64})
544+
target_link_libraries(${LAPACKLIB}_64_obj mod_files)
533545
target_compile_options(${LAPACKLIB}_64_obj PRIVATE ${FOPT_ILP64} -DLAPACK_64)
534546
set_target_properties(
535547
${LAPACKLIB}_64_obj PROPERTIES
@@ -539,6 +551,7 @@ if(BUILD_INDEX64_EXT_API)
539551
endif()
540552

541553
add_library(${LAPACKLIB}
554+
$<TARGET_OBJECTS:mod_files>
542555
$<TARGET_OBJECTS:${LAPACKLIB}_obj>
543556
$<$<BOOL:${BUILD_INDEX64_EXT_API}>: $<TARGET_OBJECTS:${LAPACKLIB}_64_obj>>)
544557
set_target_properties(

0 commit comments

Comments
 (0)