Comments (11)
- cmake will only find compilers in the PATH with default names, I think it will be fine if there was a gfortran symlink
- there is already a cmake option PRIMA_ENABLE_C=ON/OFF to disable the C binding
from prima.
- cmake will only find compilers in the PATH with default names, I think it will be fine if there was a gfortran symlink
I have sent this to @shahmoradi and invited him to join the conversation.
How does CMake decide the default name of a compiler (or tell whether something is a Fortran compiler in the first place?) Does it look up a list? Thanks.
Since @shahmoradi has five compilers installed in the system bin
, there is a good chance that at least one of them is in the PATH with default names.
from prima.
I guess it looks through standard names, for example in the CI jobs I never had to specify the compiler location as it was always found.
from prima.
*there is already a cmake option PRIMA_ENABLE_C=ON/OFF to disable the C binding
I removed /usr/bin/gcc
and some other C compilers on my computer. Doing
$git clone --depth 1 https://github.com/libprima/prima.git
cd prima
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install -DBUILD_SHARED_LIBS=OFF -DPRIMA_ENABLE_C=OFF
cmake --build build --target install
I got the following:
Cloning into 'prima'...
remote: Enumerating objects: 907, done.
remote: Counting objects: 100% (907/907), done.
remote: Compressing objects: 100% (733/733), done.
remote: Total 907 (delta 416), reused 464 (delta 154), pack-reused 0
Receiving objects: 100% (907/907), 6.20 MiB | 1.74 MiB/s, done.
Resolving deltas: 100% (416/416), done.
-- The C compiler identification is unknown
-- The Fortran compiler identification is GNU 13.1.0
CMake Error at CMakeLists.txt:5 (project):
No CMAKE_C_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/f95 - skipped
-- Configuring incomplete, errors occurred!
See also "/home/zaikunzhang/tmp/prima/build/CMakeFiles/CMakeOutput.log".
See also "/home/zaikunzhang/tmp/prima/build/CMakeFiles/CMakeError.log".
gmake: Makefile: No such file or directory
gmake: *** No rule to make target 'Makefile'. Stop.
If did not misunderstand, even with -DPRIMA_ENABLE_C=OFF
, cmake
still looks for a C compiler, and fails if no such compiler exists. Is this reasonable?
from prima.
I guess we could defer the detection of the C compiler, but ihmo its hard to find a machine with a Fortran compiler but without C compiler :]
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b0916733..c8c0d92c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.13)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
-project (prima C Fortran)
+project (prima Fortran)
option (BUILD_SHARED_LIBS "shared/static" ON)
if (WIN32)
@@ -45,6 +45,7 @@ add_subdirectory(fortran)
option (PRIMA_ENABLE_C "C binding" ON)
if (PRIMA_ENABLE_C)
+ enable_language(C)
add_subdirectory(c)
set(primac_target "primac")
endif ()
from prima.
ihmo its hard to find a machine with a Fortran compiler but without C compiler :]
Agree. But logically, it is still better to check the C compiler only when needed. After your new PR, it works now.
BTW, I saw -- Performing Test HAVE_WARN_EXECSTACK - Failed
. Should I worry?
from prima.
no, its probably just a bit too old
from prima.
no, its probably just a bit too old
Who is "it"?
from prima.
your compiler
from prima.
I modified README for this issue:
Lines 217 to 219 in 7565f6f
Is it correct?
from prima.
yes
from prima.
Related Issues (20)
- Questions about the C interface HOT 11
- C stress test failed HOT 5
- Should we return or give a warning when providing bounds/constraints to a problem that cannot handle them? HOT 7
- CI: cmake fails due to an error of gdb HOT 1
- CMake build fails on macOS-13 HOT 3
- Mexification fails on macOS with Xcode 15 and Intel oneAPI 2023
- The C example on README does not work HOT 1
- cobyla fails CMake test with flang family compilers HOT 1
- Support Function Call Parallelization in MATLAB Interface HOT 1
- Support "OutputFcn" option in MATLAB interface HOT 2
- Enable reverse communication?
- LINCOA doesn't adhere to upper and lower bounds HOT 8
- BOBYQA recursion problem HOT 3
- Rhobeg and rhoend arrays HOT 1
- Improve the scaling
- `PRIMA_INTEGER_KIND` slightly affects the result when compiled with `-Ofast -fno-stack-arrays`
- The behavior of COBYLA is slightly different when `infnan_mod` is broken and the code is compiled with `-Ofast -fno-stack-arrays`
- Should `prima_get_rc_string` be exposed in the C public API?
- CMake test fails with strict diagnostic options for Intel compilers HOT 3
- Add options.ctol to `prima_is_success` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prima.