Skip to content

Commit 232d89f

Browse files
jwestraadtNanoShotclaude
authored
Windows 11 support: ifx compiler, hardened SDK/path detection, and cross-platform fixes (#26)
* Windows: support ifx build and update README * Update Eigen download URL and ignore buildOO * Update Windows setup docs and harden oneAPI/CUDA path detection * Harden SDK path detection for ifx (IntelLLVM) and Windows build types - HDF5: fix Windows HDF5_DIR path and add cmake/hdf5 fallback - JsonFortran/bspline-fortran: detect IntelLLVM compiler (ifx) as 'intelllvm' FC_NAME, add cross-variant fallback paths and intel alias - nlopt: use BUILD_TYPE-suffixed path on Windows with fallback to legacy unsuffixed path Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Johan Westraadt <westraadt.1@osu.edu> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 602057f commit 232d89f

11 files changed

Lines changed: 246 additions & 111 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Support/Scripts/GMT/gmt.history
2323
/Release/
2424
/DebugOO/
2525
/ReleaseOO/
26+
/buildOO/
2627
.ctags
2728
.vscode
2829
/ExternalProjects

CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if(WIN32)
1515
message(STATUS "**************************************************************************")
1616
message(STATUS "* Platform: Windows")
1717
message(STATUS "* ONLY NVidia GPUs are supported on Windows platforms. Please ensure that")
18-
message(STATUS "* the NVidia GPU computing toolkit version 10.0 is installed on your")
18+
message(STATUS "* the NVidia GPU computing toolkit version 10.0 or newer is installed on your")
1919
message(STATUS "* computer before trying to compile EMsoft.")
2020
message(STATUS "**************************************************************************")
2121

@@ -187,13 +187,21 @@ FILE(APPEND ${EMsoftOO_SDK_FILE} "set(CMAKE_EXPORT_COMPILE_COMMANDS ON)\n")
187187
#------------------------------------------------------------------------------
188188
# Get the name of the Fortran compiler for easier decisions
189189
get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)
190+
set(EMSOFTOO_FORTRAN_IS_GNU OFF)
191+
set(EMSOFTOO_FORTRAN_IS_INTEL OFF)
192+
193+
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" OR Fortran_COMPILER_NAME MATCHES "gfortran.*")
194+
set(EMSOFTOO_FORTRAN_IS_GNU ON)
195+
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel" OR Fortran_COMPILER_NAME MATCHES "ifort.*" OR Fortran_COMPILER_NAME MATCHES "ifx.*")
196+
set(EMSOFTOO_FORTRAN_IS_INTEL ON)
197+
endif()
190198

191199
#------------------------------------------------------------------------------
192200
# On Windows we are going to use Intel MKL with the FFTW interface so we do not
193201
# need to install FFTW3
194-
if(${Fortran_COMPILER_NAME} MATCHES "gfortran.*")
202+
if(EMSOFTOO_FORTRAN_IS_GNU)
195203
include(FFTW)
196-
elseif (${Fortran_COMPILER_NAME} MATCHES "ifort.*")
204+
elseif(EMSOFTOO_FORTRAN_IS_INTEL)
197205
set(OSX_DEPLOYMENT_TARGET "10.13")
198206
include(MKL)
199207
else()

ReadMe.md

Lines changed: 60 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,25 @@ source code base. Note that this SDK can co-exist alongside the regular SDK buil
1515

1616
## Prerequisites ##
1717

18-
+ CMake 3.15.x or later installed on system (preferably 3.25)
19-
+ Compiler Suite installed on system
20-
+ Fortran compiler installed on system
21-
+ Git installed on the system
18+
+ CMake 3.25 or later installed on the system. The Visual Studio 2022 bundled CMake 3.31.x works.
19+
+ Compiler suite installed on the system
20+
+ Fortran compiler installed on the system
21+
+ Git 2.x installed on the system
22+
+ On Windows for this branch, install Visual Studio 2022 plus Intel oneAPI Base Toolkit and HPC Toolkit so that `ifx` and MKL are available
2223

2324
## Supported Platforms ##
2425

25-
| Operating System | C/C++ Compiler | Fortran Compiler |
26-
|------------------|----------------|------------------|
27-
| macOS (>=10.13) | Xcode Native tools (10/11) | GFortran 6.3.0 or Intel Fortran 19\*\* |
28-
| Windows (10) | Visual Studio 2015 (CE/Pro) | Intel Fortran v17/v19 |
29-
| Linux (Ubuntu 16.x, CentOS 7.x) | GCC 7.x and Above, Clang 3.8 and greater | GNU Fortran 6.3.5 20160904 or newer |
26+
| Operating System | C/C++ Compiler | Fortran Compiler | Status |
27+
|------------------|----------------|------------------|--------|
28+
| macOS (>=10.13) | Xcode Native tools (10/11) | GFortran 6.3.0 or Intel Fortran 19\*\* | Legacy instructions |
29+
| Windows 11 | Visual Studio 2022 | Intel oneAPI `ifx` | Validated on this branch |
30+
| Linux (Ubuntu 16.x, CentOS 7.x) | GCC 7.x and above, Clang 3.8 and greater | GNU Fortran 6.3.5 20160904 or newer | Legacy instructions |
3031

3132
\*\*macOS Note: If you are installing Intel Fortran try to install into a location **other** then /opt/intel which is the default. Try /opt/intel_sw instead.
3233

3334
## Git Locations ##
3435

35-
Git verison 2.x is required.
36+
Git version 2.x is required.
3637

3738
| Operating System | Notes |
3839
|------------------|--------------|
@@ -47,7 +48,7 @@ Git verison 2.x is required.
4748
| HDF5 | 1.12.2 | Compiled from Source |
4849
| CLFortran | 0.0.1 | Compiled from Source on GitHub |
4950
| FFTW | 3.3.5 | Compiled (macOS/Linux) |
50-
| Intel MKL | 2019_xxxx | Precompiled for IFort compilers (windows & macos) |
51+
| Intel MKL | oneAPI install | Uses the MKL installation that ships with Intel oneAPI on Windows |
5152
| Json-Fortran | 4.2.1 | Compiled from source on GitHub |
5253
| Eigen | 3.3.5 | Compiled from Source |
5354
| Qt 5 | 5.12.4 | Precompiled Binaries from [www.qt.io](http://download.qt.io) |
@@ -75,34 +76,59 @@ Git verison 2.x is required.
7576

7677
## Windows Instructions ##
7778

78-
*Currently ONLY NMake files are supported. Visual Studio support is being looked at*
79+
> "All hope abandon ye who enter here..."
7980
80-
1. Install your compiler tools
81-
2. Install CMake on your system
82-
3. Install a Fortran compiler on your system
83-
4. Install Git on your system
84-
5. Create the following Directories:
85-
+ C:/Users/[USERNAME]/EMsoftOO_SDK
86-
+ C:/Users/[USERNAME]/EMsoft-Dev
87-
6. Open a command prompt and invoke the following commands
81+
Toolchain installation behavior can vary across compiler, CUDA, CMake, and IDE versions, and package layouts may differ between systems. As a result, additional post-install configuration is often required; in practice, a disciplined, agentic workflow (iterative validation, environment checks, and targeted reconfiguration) is necessary for reliable setup.
82+
83+
This branch is currently validated on Windows with the `NMake Makefiles` generator, Visual Studio 2022 Community, and Intel oneAPI `ifx` (tested with Visual Studio 2022 17.14.x, oneAPI 2025.3.1, CUDA 12.9.1, and the Visual Studio 2022 bundled CMake 3.31.x).
84+
85+
### Toolchain Installation ###
86+
87+
1. Install Visual Studio 2022 Community 17.14.x with the Desktop development with C++ workload.
88+
+ Download bootstrapper: [vs_community.exe](https://aka.ms/vs/17/release/vs_community.exe)
89+
+ Release history (17.x details): [Visual Studio 2022 Release History](https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history)
90+
2. Install Intel oneAPI Base Toolkit 2025.3.1.35 (provides MKL and core toolchain pieces).
91+
+ Download: [intel-oneapi-base-toolkit-2025.3.1.35.exe](https://registrationcenter-download.intel.com/akdlm/IRC_NAS/076e961b-2c29-48a8-9203-c96f00e7051b/intel-oneapi-base-toolkit-2025.3.1.35.exe)
92+
3. Install Intel oneAPI HPC Toolkit 2025.3.1.54 (provides `ifx` Fortran).
93+
+ Download: [intel-oneapi-hpc-toolkit-2025.3.1.54_offline.exe](https://registrationcenter-download.intel.com/akdlm/IRC_NAS/36f868e9-84b3-4b4f-90ef-ca84092cae6a/intel-oneapi-hpc-toolkit-2025.3.1.54_offline.exe)
94+
4. Install NVIDIA CUDA Toolkit 12.9.1 if `BUILD_CLFortran=ON` (required for OpenCL headers/libs used by CLFortran on Windows).
95+
+ Download page (Windows x86_64): [CUDA Toolkit 12.9.1 Downloads](https://developer.nvidia.com/cuda-12-9-1-download-archive?target_arch=x86_64&target_os=Windows)
96+
5. Install Git.
97+
6. Install CMake 3.25 or later, or use the CMake that ships with Visual Studio 2022.
98+
99+
### Configure and Build ###
100+
101+
1. Open a Command Prompt window.
102+
2. Initialize the Visual Studio 2022 and Intel oneAPI build environment:
103+
104+
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 vs2022
105+
106+
3. Choose an SDK install location, for example:
107+
108+
C:/Users/[USERNAME]/EMsoftOO_SDK
88109

89-
cd C:/Users/[USERNAME]/EMsoft-Dev
90-
git clone git://www.github.com/emsoft-org/EMsoftSuperbuild
110+
4. Clone the repository and configure a Release build:
111+
112+
cd C:/Users/[USERNAME]
113+
git clone https://github.com/EMsoft-org/EMsoftSuperbuild.git
91114
cd EMsoftSuperbuild
92-
mkdir Debug
93-
cd Debug
94-
cmake -G "NMake Makefiles" -DEMsoftOO_SDK=C:/Users/[USERNAME]/EMsoftOO_SDK -DCMAKE_BUILD_TYPE=Debug ../
95-
nmake
96-
cd ../
97-
mkdir Release
98-
cd Release
99-
cmake -G "NMake Makefiles" -DEMsoftOO_SDK=C:/Users/[USERNAME]/EMsoftOO_SDK -DCMAKE_BUILD_TYPE=Release ../
100-
make -j
115+
cmake -S . -B build-ifx -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_Fortran_COMPILER=ifx -DEMsoftOO_SDK=C:/Users/[USERNAME]/EMsoftOO_SDK -DINSTALL_QT5=OFF
116+
117+
5. Build the SDK:
118+
119+
cmake --build build-ifx
120+
121+
6. After a successful build, the generated SDK configuration file will be located at:
122+
123+
C:/Users/[USERNAME]/EMsoftOO_SDK/EMsoftOO_SDK.cmake
101124

102-
7. The initial run of CMake is going to take **REALLY** long time because it will be downloading the full Qt 5.x installer which is about 3~4 GB in size. On macOS systems it then must verify the .dmg, mount it and run the installer (which verifies the .app). Go get coffee. Compiling (the 'make -j' part) should not take that long, only about 5 minutes or so.
125+
7. To generate a Debug SDK, use a different build directory and switch `-DCMAKE_BUILD_TYPE=Debug`.
103126

104-
**NOTE**: there is currently a known issue where the Qt 5.x installer will NOT actually run during the Linux cmake process. If the user does *NOT* want to build the GUI application then this is fine. If the user does want to build the GUI application then they will need to install Qt 5.x themselves. The download will be at /path/to/EMsoft_SDK/superbuild/Qt/download
127+
### Notes ###
105128

106-
The developer can use CMakeGui if they would like instead of the command lines. The only required variable are the path to where you want the EMsoft_SDK folder and the build type (Debug or Release)
129+
+ `-DINSTALL_QT5=OFF` builds the command-line dependency stack only. Set `-DINSTALL_QT5=ON` if you also want Qt 5 and EBSDLib.
130+
+ Enabling Qt will trigger a very large Qt download during the first configure.
131+
+ If CUDA is installed in a non-default location, set `-DNVIDIA_CUDA_DIR=<path>` and `-DNVIDIA_CUDA_DEV_VERSION=12.9`.
132+
+ The developer can also use CMake GUI. The required variables are `EMsoftOO_SDK` and `CMAKE_BUILD_TYPE`.
107133

108134
Once the SDK builds correctly, no errors are reported on the command line, then the developer can proceed to clone and build EMsoft itself.

projects/Bcls.cmake

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,15 @@ else()
4545
endif()
4646
endif()
4747

48-
if(${Fortran_COMPILER_NAME} MATCHES "gfortran.*")
48+
if(EMSOFTOO_FORTRAN_IS_GNU)
4949
set(BCLS_USE_MKL "OFF")
50-
elseif (${Fortran_COMPILER_NAME} MATCHES "ifort.*")
50+
elseif(EMSOFTOO_FORTRAN_IS_INTEL)
5151
set(BCLS_USE_MKL "ON")
52+
set(BCLS_MKL_DIR "${MKL_DIR}")
53+
if(NOT "${BCLS_MKL_DIR}" STREQUAL "")
54+
# Avoid backslash escape parsing issues in generated ExternalProject scripts on Windows.
55+
file(TO_CMAKE_PATH "${BCLS_MKL_DIR}" BCLS_MKL_DIR)
56+
endif()
5257
else()
5358
message(STATUS "The Fotran compiler is NOT recognized. EMsoft may not support it.")
5459
message(FATAL_ERROR "Current Fotran Compiler is ${CMAKE_Fortran_COMPILER}")
@@ -77,7 +82,7 @@ ExternalProject_Add(${extProjectName}
7782
-DOpenCL_INCLUDE_DIR:PATH=${OpenCL_INCLUDE_DIR}
7883
-DOpenCL_LIBRARY:FILEPATH=${OpenCL_LIBRARY}
7984
-DBCLS_USE_MKL:BOOL=${BCLS_USE_MKL}
80-
-DMKL_DIR:PATH=${MKL_DIR}
85+
-DMKL_DIR:STRING=${BCLS_MKL_DIR}
8186

8287
LOG_DOWNLOAD 1
8388
LOG_UPDATE 1

projects/CLFortran.cmake

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,53 @@ set_property(DIRECTORY PROPERTY EP_BASE ${EMsoftOO_SDK}/superbuild)
2828

2929
if(WIN32)
3030
set(MIN_CUDA_VERSION "10.0")
31-
set(NVIDIA_CUDA_DEV_VERSION ${MIN_CUDA_VERSION} CACHE STRING "CUDA developer version, to use")
32-
if(${NVIDIA_CUDA_DEV_VERSION} LESS ${MIN_CUDA_VERSION})
33-
message(FATAL_ERROR "NVIDIA CUDA version must be at least ${MIN_CUDA_VERSION} (got ${NVIDIA_CUDA_DEV_VERSION})")
34-
endif()
31+
set(NVIDIA_CUDA_DEV_VERSION "" CACHE STRING "CUDA developer version to use (for example: 12.9). Leave empty to auto-detect the latest installed version.")
3532
if("${NVIDIA_CUDA_DIR}" STREQUAL "")
3633
set(NVIDIA_CUDA_DIR "C:/Program Files/NVIDIA GPU Computing Toolkit")
3734
message(STATUS "NVIDIA CUDA Install: Using default location of ${NVIDIA_CUDA_DIR}")
3835
endif()
36+
37+
if(NOT EXISTS "${NVIDIA_CUDA_DIR}/CUDA")
38+
message(STATUS "NVIDIA GPU Computing Toolkit is NOT in selected location.")
39+
message(STATUS "Please set NVIDIA_CUDA_DIR to the top-level NVIDIA toolkit directory.")
40+
message(STATUS "Or disable CLFortran with -DBUILD_CLFortran=OFF for CPU-only builds.")
41+
message(FATAL_ERROR "NVIDIA CUDA toolkit root not found: ${NVIDIA_CUDA_DIR}/CUDA")
42+
endif()
43+
44+
if("${NVIDIA_CUDA_DEV_VERSION}" STREQUAL "")
45+
file(GLOB _cuda_dirs RELATIVE "${NVIDIA_CUDA_DIR}/CUDA" "${NVIDIA_CUDA_DIR}/CUDA/v*")
46+
set(_detected_cuda_version "")
47+
foreach(_cuda_dir IN LISTS _cuda_dirs)
48+
string(REGEX REPLACE "^v" "" _cuda_ver "${_cuda_dir}")
49+
if(NOT _cuda_ver VERSION_LESS ${MIN_CUDA_VERSION})
50+
if("${_detected_cuda_version}" STREQUAL "" OR _cuda_ver VERSION_GREATER _detected_cuda_version)
51+
set(_detected_cuda_version "${_cuda_ver}")
52+
endif()
53+
endif()
54+
endforeach()
55+
set(NVIDIA_CUDA_DEV_VERSION "${_detected_cuda_version}" CACHE STRING "CUDA developer version to use (for example: 12.9). Leave empty to auto-detect the latest installed version." FORCE)
56+
if(NOT "${NVIDIA_CUDA_DEV_VERSION}" STREQUAL "")
57+
message(STATUS "NVIDIA CUDA Install: Auto-detected version ${NVIDIA_CUDA_DEV_VERSION}")
58+
endif()
59+
endif()
60+
61+
if("${NVIDIA_CUDA_DEV_VERSION}" STREQUAL "")
62+
message(STATUS "No compatible CUDA installation was detected (minimum required: ${MIN_CUDA_VERSION}).")
63+
message(STATUS "Install CUDA from https://developer.nvidia.com/cuda-downloads")
64+
message(STATUS "or disable CLFortran with -DBUILD_CLFortran=OFF")
65+
message(FATAL_ERROR "NVIDIA CUDA is not installed or not detected")
66+
endif()
67+
68+
if(${NVIDIA_CUDA_DEV_VERSION} VERSION_LESS ${MIN_CUDA_VERSION})
69+
message(FATAL_ERROR "NVIDIA CUDA version must be at least ${MIN_CUDA_VERSION} (got ${NVIDIA_CUDA_DEV_VERSION})")
70+
endif()
71+
3972
if(NOT EXISTS "${NVIDIA_CUDA_DIR}/CUDA/v${NVIDIA_CUDA_DEV_VERSION}")
4073
message(STATUS "NVIDIA GPU Computing Toolkit is NOT in selected location.")
41-
message(STATUS "Please set the NVIDIA_CUDA_DIR CMake variable to point to the top level installation of the NVIDIA GPU Computing Toolkit installation")
74+
message(STATUS "Please set NVIDIA_CUDA_DIR to the top-level NVIDIA toolkit directory.")
4275
message(STATUS "CLFortran uses version ${NVIDIA_CUDA_DEV_VERSION} of that toolkit.")
43-
message(STATUS "Downlaod from ${NVIDIA_CUDA_DEV_VERSION} https://developer.nvidia.com/cuda-${NVIDIA_CUDA_DEV_VERSION}-download-archive")
44-
message(STATUS "or change NVIDIA_CUDA_DEV_VERSION to installed version")
76+
message(STATUS "Download archive: https://developer.nvidia.com/cuda-download-archive")
77+
message(STATUS "or change NVIDIA_CUDA_DEV_VERSION to an installed version")
4578
message(FATAL_ERROR "NVIDIA CUDA ${NVIDIA_CUDA_DEV_VERSION} is not installed or not detected")
4679
endif()
4780

projects/Eigen.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set(Eigen_VERSION "3.3.9")
1313
message(STATUS "Building: ${extProjectName} ${Eigen3_VERSION}: -DBUILD_EIGEN=${BUILD_EIGEN}")
1414

1515
#set(Eigen_URL "https://bitbucket.org/eigen/eigen/get/${Eigen_VERSION}.tar.gz")
16-
set(Eigen_URL "http://dream3d.bluequartz.net/binaries/SDK/Eigen-${Eigen_VERSION}.tar.gz")
16+
set(Eigen_URL "https://gitlab.com/libeigen/eigen/-/archive/${Eigen_VERSION}/eigen-${Eigen_VERSION}.tar.gz")
1717
set(SOURCE_DIR "${EMsoftOO_SDK}/superbuild/${extProjectName}/Source/${extProjectName}.tar.gz")
1818

1919
if(WIN32)

projects/HDF5.cmake

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,39 @@ message(STATUS "Building: ${extProjectName} ${HDF5_VERSION}: -DBUILD_HDF5=${BUIL
1919

2020
set(HDF5_BUILD_SHARED_LIBS ON)
2121
set(HDF5_INSTALL "${EMsoftOO_SDK}/${extProjectName}-${HDF5_VERSION}-${CMAKE_BUILD_TYPE}")
22+
set(HDF5_CMAKE_ARGS
23+
-DBUILD_SHARED_LIBS:BOOL=${HDF5_BUILD_SHARED_LIBS}
24+
-DBUILD_STATIC_LIBS:BOOL=ON
25+
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
26+
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
27+
-DCMAKE_Fortran_COMPILER:FILEPATH=${CMAKE_Fortran_COMPILER}
28+
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
29+
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
30+
-DCMAKE_OSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET}
31+
-DCMAKE_OSX_SYSROOT=${OSX_SDK}
32+
-DCMAKE_CXX_STANDARD=11
33+
-DCMAKE_C_STANDARD=11
34+
-DCMAKE_CXX_STANDARD_REQUIRED=ON
35+
-DHDF5_BUILD_WITH_INSTALL_NAME=ON
36+
-DHDF5_BUILD_CPP_LIB=ON
37+
-DHDF5_BUILD_HL_LIB=ON
38+
-DHDF_PACKAGE_NAMESPACE=hdf5::
39+
-DHDF5_BUILD_FORTRAN=ON
40+
-DHDF5_BUILD_EXAMPLES=OFF
41+
-DBUILD_TESTING=OFF
42+
)
43+
44+
if(WIN32 AND CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM")
45+
# ifx fails while linking the shared high-level Fortran HDF5 library, but the
46+
# static HDF5/Fortran libraries build cleanly and are sufficient for the SDK.
47+
set(HDF5_BUILD_SHARED_LIBS OFF)
48+
list(REMOVE_AT HDF5_CMAKE_ARGS 0)
49+
list(INSERT HDF5_CMAKE_ARGS 0 -DBUILD_SHARED_LIBS:BOOL=${HDF5_BUILD_SHARED_LIBS})
50+
list(APPEND HDF5_CMAKE_ARGS
51+
-DONLY_SHARED_LIBS:BOOL=OFF
52+
-DHDF5_INSTALL_MOD_FORTRAN:STRING=STATIC
53+
)
54+
endif()
2255

2356

2457
if( CMAKE_BUILD_TYPE MATCHES Debug )
@@ -59,24 +92,8 @@ ExternalProject_Add(${extProjectName}
5992
INSTALL_DIR "${HDF5_INSTALL}"
6093

6194
CMAKE_ARGS
62-
-DBUILD_SHARED_LIBS:BOOL=${HDF5_BUILD_SHARED_LIBS}
63-
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
64-
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
65-
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
66-
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
95+
${HDF5_CMAKE_ARGS}
6796
${C_CXX_FLAGS}
68-
-DCMAKE_OSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET}
69-
-DCMAKE_OSX_SYSROOT=${OSX_SDK}
70-
-DCMAKE_CXX_STANDARD=11
71-
-DCMAKE_C_STANDARD=11
72-
-DCMAKE_CXX_STANDARD_REQUIRED=ON
73-
-DHDF5_BUILD_WITH_INSTALL_NAME=ON
74-
-DHDF5_BUILD_CPP_LIB=ON
75-
-DHDF5_BUILD_HL_LIB=ON
76-
-DHDF_PACKAGE_NAMESPACE=hdf5::
77-
-DHDF5_BUILD_FORTRAN=ON
78-
-DHDF5_BUILD_EXAMPLES=OFF
79-
-DBUILD_TESTING=OFF
8097

8198
LOG_DOWNLOAD 1
8299
LOG_UPDATE 1
@@ -96,10 +113,13 @@ if(APPLE)
96113
FILE(APPEND ${EMsoftOO_SDK_FILE} "set(HDF5_DIR \"\${EMsoftOO_SDK_ROOT}/${extProjectName}-${HDF5_VERSION}-\${BUILD_TYPE}/cmake\" CACHE PATH \"\")\n")
97114
elseif(WIN32)
98115
FILE(APPEND ${EMsoftOO_SDK_FILE} "set(HDF5_INSTALL \"\${EMsoftOO_SDK_ROOT}/${extProjectName}-${HDF5_VERSION}-\${BUILD_TYPE}\" CACHE PATH \"\")\n")
99-
FILE(APPEND ${EMsoftOO_SDK_FILE} "set(HDF5_DIR \"\${EMsoftOO_SDK_ROOT}/${extProjectName}-${HDF5_VERSION}-\${BUILD_TYPE}/cmake/hdf5\" CACHE PATH \"\")\n")
116+
FILE(APPEND ${EMsoftOO_SDK_FILE} "set(HDF5_DIR \"\${EMsoftOO_SDK_ROOT}/${extProjectName}-${HDF5_VERSION}-\${BUILD_TYPE}/cmake\" CACHE PATH \"\")\n")
100117
else()
101118
FILE(APPEND ${EMsoftOO_SDK_FILE} "set(HDF5_INSTALL \"\${EMsoftOO_SDK_ROOT}/${extProjectName}-${HDF5_VERSION}-\${BUILD_TYPE}\" CACHE PATH \"\")\n")
102119
FILE(APPEND ${EMsoftOO_SDK_FILE} "set(HDF5_DIR \"\${EMsoftOO_SDK_ROOT}/${extProjectName}-${HDF5_VERSION}-\${BUILD_TYPE}/cmake\" CACHE PATH \"\")\n")
103120
endif()
121+
FILE(APPEND ${EMsoftOO_SDK_FILE} "if(NOT EXISTS \"\${HDF5_DIR}/hdf5-config.cmake\" AND EXISTS \"\${HDF5_INSTALL}/cmake/hdf5/hdf5-config.cmake\")\n")
122+
FILE(APPEND ${EMsoftOO_SDK_FILE} " set(HDF5_DIR \"\${HDF5_INSTALL}/cmake/hdf5\" CACHE PATH \"\" FORCE)\n")
123+
FILE(APPEND ${EMsoftOO_SDK_FILE} "endif()\n")
104124
FILE(APPEND ${EMsoftOO_SDK_FILE} "set(CMAKE_MODULE_PATH \${CMAKE_MODULE_PATH} \${HDF5_DIR})\n")
105125
FILE(APPEND ${EMsoftOO_SDK_FILE} "set(HDF5_VERSION \"${HDF5_VERSION}\" CACHE STRING \"\")\n")

0 commit comments

Comments
 (0)