Closed TLCFEM closed 5 months ago
- we already supported some of the new and old versions of intel compilers what version are you using, maybe its something we do not support yet ?
It is mainly about the VS
generator. Things are all fine with ninja
. For VS
, mixing source files is not supported. So have to split into two object libraries.
add_library(primac_f OBJECT cintrf.f90 cobyla_c.f90 lincoa_c.f90 bobyqa_c.f90 newuoa_c.f90 uobyqa_c.f90)
add_library(primac_c OBJECT prima.c)
Then need to define the macro add_compile_definitions(PRIMAC_EXPORTS)
.
Also, the .mod
files are not placed directly under fortran/mod
but fortran/mod/${CMAKE_CFG_INTDIR}
for VS
generator, so need to include this folder otherwise .mod
cannot be found.
- the declspec macros should only appear in declaration, never in definition so I doubt this is correct
Indeed, it is not correct. They have been reverted.
- so you should modify the macro in prima.h to use primac_c_EXPORTS, not define another one
primac_c_EXPORTS
is also not defined since now primac_c
is an object library not a shared one. I think target_EXPORTS
is only defined for shared libraries.
- this should be added to be tested in the github workflow cmake.yml
Depending on how you want it to be, there are multiple options, like,
- name: Build
if: ${{ matrix.os == 'windows-latest' }}
run: |
cmake --version
cmake -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${{ matrix.toolchain.cflags }}" -DCMAKE_Fortran_FLAGS="${{ matrix.toolchain.fflags }}" .
matrix.generator = ninja
and specialise later in matrix.include
.The simpler the better
Thank you @TLCFEM for proposing this. Excuse me for the late response. Is there an agreement on this? Thanks.
Some changes to make it compile with Intel compiler.