Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provides initial support for Fortran MEX #375

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

pbpf
Copy link

@pbpf pbpf commented Dec 25, 2024

Provides initial support for Fortran MEX

Testing environment: windows11 + intel fortran 2024.2 + intel oneMKL 2024.2 + matlab R2024b
Test Items: hls_ma48
Test CMakeLists.txt:

cmake_minimum_required(VERSION 3.31)

set(CMAKE_GENERATOR_TOOLSET "fortran=ifx")
set(FORTRANMEX ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
project(hsl_ma48 VERSION 1.0 LANGUAGES  Fortran)
set(SOURCES
    src/ddeps.f
    src/ddeps90.f90
    src/common90.f90
    src/hsl_ma48d.f90
)


add_library(hsl_ma48 STATIC  ${SOURCES})
find_package(MKL CONFIG REQUIRED)

target_link_libraries(hsl_ma48   PUBLIC  MKL::MKL) 

find_package(Matlab REQUIRED COMPONENTS MAT_LIBRARY MEX_COMPILER )

set(MATLAB_SORCES
    matlab/hsl_ma48_expert.f90
    matlab/hsl_matlab.F90
)
 
matlab_add_mex(NAME hsl_ma48_expert SHARED SRC ${MATLAB_SORCES}  LINK_TO hsl_ma48 R2017b)

Test results:

[main] building folder: d:/srcp/code/solvers/hsl_ma48-3.4.2/build hsl_ma48_expert
[build] is starting the build
[proc] command: "C:Program FilesCMakebincmake.EXE" --build d:/srcp/code/solvers/hsl_ma48-3.4.2/build --config Release --target hsl_ma48_expert -j 10 --
[build] 
[build] Microsoft Visual Studio 2022 version 17.12.3.
[build] Copyright (C) Microsoft Corp. All rights reserved.
[build] build starts at 17:02...
[build] 1>------ Build started: Project: ZERO_CHECK, Configuration: Release x64 ------
[build] ========== builds: 1 success, 0 failure, 2 latest, 0 skipped ==========
[build] ========== build completed at 17:02 and took 00.702 seconds ==========
[driver] generated: 00:00:06.073
[build] build completed with exit code 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant