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

Cannot build Fortran examples #93

Open
chrispbradley opened this issue Sep 12, 2017 · 6 comments
Open

Cannot build Fortran examples #93

chrispbradley opened this issue Sep 12, 2017 · 6 comments

Comments

@chrispbradley
Copy link
Member

There are still problems building Fortran examples with the new build system. I updated my setup, manage, cmake_modules to the latest develop versions, completely deleted my build and install trees, and rebuilt OpenCMISS. Trying to build the Burgers Fortran example using the same CMakeLists.txt files that Soroush used gives

cmake -DOpenCMISSLibs_DIR=/data/OpenCMISS/install ../../.
CMake Error at /data/OpenCMISS/install/opencmisslibs-config.cmake:74 (include):
include could not find load file:

/data/OpenCMISS/install/./context.cmake

Call Stack (most recent call first):
CMakeLists.txt:28 (find_package)

CMake Error at /data/OpenCMISS/install/opencmisslibs-config.cmake:81 (message):
Mismatch between the current context toolchain () and the toolchain in use
(gnu).
Call Stack (most recent call first):
CMakeLists.txt:28 (find_package)

-- Configuring incomplete, errors occurred!

The first error is that the architecture path has not been set properly by the CMake scripts. This is not surprising as the toolchain, MPI etc. etc. is not considered as per #86. This then leads to the second error of mismatch.

@hsorby
Copy link
Contributor

hsorby commented Sep 13, 2017

What are the contents of the context.cmake file? and context-*.cmake file?

@chrispbradley
Copy link
Member Author

chrispbradley commented Sep 14, 2017

The issue is not what is in content.cmake but rather where it is located. The install/opencmisslibs-config.cmake looks for context.cmake via

Include the context settings info

include(${_CONTEXT_PATH}/context.cmake)

with

set(_CONTEXT_PATH "${_OPENCMISS_IMPORT_PREFIX}${ARCHPATHNOMPI}")

The ${ARCHPATHNOMPI} depends on a number of things like OS, system, compiler, etc. etc. The current opencmisslibs-config.cmake does not check things like compiler etc. etc. before setting the arch path and thus it can not know what the right arch path is.

@chrispbradley
Copy link
Member Author

In addtion, a number of the compiler variables need to be set before project is called from the orginal example CMakeLists.txt so selecting the compiler/mpi/etc. needs to be done there.

@hsorby
Copy link
Contributor

hsorby commented Sep 14, 2017

What do the lines 62:70 show in the opencmisslibs-config.cmake file?

@chrispbradley
Copy link
Member Author

#############################################################################

Assemble architecture-path dependent search locations

set(ARCHPATH /.)
set(ARCHPATHNOMPI /.)
if ()
include(OCArchitecturePathFunctions)
getArchitecturePath(ARCHPATHNOMPI ARCHPATH)
endif()

@chrispbradley
Copy link
Member Author

Trouble is the OCArchitecturePathFunctions etc will need the OPENCMISS_TOOLCHAIN and OPENCMISS_MPI variables etc. to be set and it will not be good enough to set them as the compiler etc. needs to be set before the PROJECT call in the example CMakeLists.txt.

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

No branches or pull requests

2 participants