Git Product home page Git Product logo

Comments (9)

s1291 avatar s1291 commented on July 21, 2024 1

@JanssensNick :
Hello,
I experienced the same problem when trying to install bitpit, (You can check the closed issues).
If I remember well, then you can proceed as follows:
Below, I am using ccmake instead of CMake.
In my case, bitpit doesn't detect the content of the variables PETSC_DIR and PETSC_ARCH so you must change them manually in ccmake (make sure that they are correct). That is, in ccmake, make sure that:

PETSC_DIR is /home/nick/bitpit-bitpit-1.6.0/build/petsc-3.9.4
PETSC_ARCH is arch-linux2-c-debug

After that I guess, you will get another error, about the variable PETSC_RUN_EXECUTABLES (I don't rememeber exactly). So in order to solve that, you need to run ccmake like this:

cmake .. -DPETSC_EXECUTABLE_RUNS=ON

from bitpit.

marcocisternino avatar marcocisternino commented on July 21, 2024

from bitpit.

JanssensNick avatar JanssensNick commented on July 21, 2024

Dear,
Thank you very much for your answer! Regarding the first 2 remarks:

  • I've installed PETSc and I've set the variables PETSC_DIR and PETSC_ARCH as environmental variable, which I verified with echo:
    • PETSC_DIR = .../petsc-3.94 (the root folder of PETSC)
    • PETSC_ARCH = arch-linux2-c-debug
      and these are also the values that the installer suggested. However, when I run the ccmake command with the error from my previous post, I also see this:
      ccmakeError
      where the PETSC_DIR is not set anymore (even though I verified it that I set it as an environmental variable).
      I've also included the requested log files.
      configure.log
      make.log

Thank you very much in advance.
Nick Janssens

from bitpit.

marcocisternino avatar marcocisternino commented on July 21, 2024

Dear Nick,
your files contain only your path to the files, I need their original content in order to help you.
Your variable values are quite weird:
PETSC_DIR = .../petsc-3.94 ? What does it mean, please?
I give you an example:
$ echo $PETSC_DIR
/opt/petsc/petsc-3.7.5

In PETSc configuration what do you set as prefix? If you didn't set it the default value is /usr/local. Therefore, echo $PETSC_DIR should answer either /usr/local or what you set as prefix. If you set "../petsc-3.94" as prefix, I hope you used 2 points and not 3, PETSc has been installed in the build folder parent folder.
Probably, we can solve the problem if you send us the right configure.log and make.log.

Thanks,

Marco Cisternino

from bitpit.

JanssensNick avatar JanssensNick commented on July 21, 2024

Dear Marco
Oops, I didn't notice that, the correct log files should now be attached:
configure.log
make.log

Concerning the variable values, .. was an abbreviation of the full path, so:

  • echo $PETSC_DIR: /home/nick/bitpit-bitpit-1.6.0/build/petsc-3.9.4
  • echo $PETSC_ARCH: arch-linux2-c-debug
    (I've installed my petsc directory in the bitpit build directory, this is not ideal but shouldn't be a problem, right?)

Maybe something else that can be useful: I've set the PETSC_DIR and PETSC_ARCH values as environmental variables in my .bashrc file after the installation of PETSC. If I did echo $PETSC_DIR right after the installation of PETSC, the variables were empty. This is why I manually set them in .bashrc.

Thank you in advance

Nick

from bitpit.

JanssensNick avatar JanssensNick commented on July 21, 2024

Dear,
Thank very much, this did the trick! However, now I am getting this error message:
cmakeError
which I don't quite understand. Any thoughts? I tried to set the path to my cmake executables like this:
ccmakeErrorBis
by setting the value in CMakeLists.txt, but the Path is not recognised.
Nick

from bitpit.

s1291 avatar s1291 commented on July 21, 2024

@JanssensNick
I think this is a CMake internal error, so:

  • First try to remove the build folder, close the terminal, and open a new one. Now try again to build bitpit (of course, follow the instructions above regarding PETSC_DIR and PETSC_ARCH.
  • If you still get the same error, please try to re-install your cmake. Then try to build bitpit.

from bitpit.

JanssensNick avatar JanssensNick commented on July 21, 2024

I tried both suggestions, but they didn't work. Any other ideas?

from bitpit.

pkestene avatar pkestene commented on July 21, 2024

In top-level CMakeLists.txt (from current master branch), actually cmake variables PETSC_DIR and PETSC_ARCH are hardwired respectively to an empty string and "arch-linux2-c", which somehow short-circuits the job that should be done inside FindPETSc.cmake :

...
if (MODULE_LA_ENABLED)
    list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external/PETSc/cmake")

    set(PETSC_DIR "" CACHE PATH "Directory in which PETSc resides")
    set(PETSC_ARCH "arch-linux2-c" CACHE STRING "Build architecture")

    find_package(PETSc REQUIRED)

    list (APPEND BITPIT_EXTERNAL_DEPENDENCIES "PETSc")
    list (APPEND BITPIT_EXTERNAL_LIBRARIES "${PETSC_LIBRARIES}")
    list (APPEND BITPIT_EXTERNAL_INCLUDE_DIRS "${PETSC_INCLUDES}" )
endif()

Setting cmake variables PETSC_DIR and PETSC_VAR in top-level CMakeLists.txt completely shadows env variable with the same name, which are then never taken into account inside FindPETSc.cmake.

I suggest to first use values optionnal given in the cmake (or ccmake) configure command line and then check if the env variable were set, something like :

# create a cmake cache variable
set(PETSC_DIR "" CACHE PATH "Installation directory of PETSC library")

# if user gave value on the command line -DPETSC_DIR=/some/location/to/petsc it will be used
# then consider using the env. var. PETSC_DIR only if not already given through the CMake cache var.
if (NOT PETSC_DIR AND DEFINED ENV{PETSC_DIR})
  set(PETSC_DIR "$ENV{PETSC_DIR}")
  message(STATUS "PETSC_DIR found in environment : ${PETSC_DIR}")
endif() 

These checks should probably be done at the begining of the FindPETSc.cmake

from bitpit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.