<div dir="ltr">Hi,<div>I feel very sorry because I sent the wrong site.  I fork the module: <a href="https://github.com/jedbrown/cmake-modules">https://github.com/jedbrown/cmake-modules</a><br></div><div><br></div><div>Thanks,</div><div>Yingjie</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Yingjie Wu <<a href="mailto:yjwu16@gmail.com">yjwu16@gmail.com</a>> 于2019年12月4日周三 下午11:14写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear Petsc developers<div>Hi,</div><div>Because I use some external library files, I want to compile the PETSc program with CMake. I follow the library search program <a href="https://github.com/CoolProp/CoolProp/blob/b493de51a44078e4f5bbb8712e89305fd91f8b85/CMakeLists.txt" target="_blank">https://github.com/CoolProp/CoolProp/blob/b493de51a44078e4f5bbb8712e89305fd91f8b85/CMakeLists.txt</a> recommended on GitHub. And wrote a cmakelist.txt:            </div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>cmake_minimum_required(VERSION 2.8.11)<br>project(example01cmke)<br>add_executable(example01cmke ex1.cpp)<br>set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)<br>find_package(PETSc)<br>include_directories(${PETSC_INCLUDE_DIR})<br>target_link_libraries(example01cmke ${PETSC_LIBRARIES})<br></div></blockquote></div><div>My document relationships are:           </div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>yjwu@yjwu-XPS-8910:~/PETSctest/Testcmake$ tree<br>.<br>├── build<br>├── cmake<br>│   └── modules<br>│       ├── CorrectWindowsPaths.cmake<br>│       ├── FindFFTW.cmake<br>│       ├── FindGit.cmake<br>│       ├── FindGSL.cmake<br>│       ├── FindITAPS.cmake<br>│       ├── FindNetCDF.cmake<br>│       ├── FindPackageMultipass.cmake<br>│       ├── FindPETSc.cmake<br>│       ├── LICENSE<br>│       ├── README<br>│       └── ResolveCompilerPaths.cmake<br>├── CMakeLists.txt<br>└── ex1.cpp<br></div></blockquote></div><div> After compiling with cmake.. and make, there is an error message:            </div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>yjwu@yjwu-XPS-8910:~/PETSctest/Testcmake/build$ cmake ..<br>-- The C compiler identification is GNU 5.4.0<br>-- The CXX compiler identification is GNU 5.4.0<br>-- Check for working C compiler: /usr/bin/cc<br>-- Check for working C compiler: /usr/bin/cc -- works<br>-- Detecting C compiler ABI info<br>-- Detecting C compiler ABI info - done<br>-- Detecting C compile features<br>-- Detecting C compile features - done<br>-- Check for working CXX compiler: /usr/bin/c++<br>-- Check for working CXX compiler: /usr/bin/c++ -- works<br>-- Detecting CXX compiler ABI info<br>-- Detecting CXX compiler ABI info - done<br>-- Detecting CXX compile features<br>-- Detecting CXX compile features - done<br>-- petsc_lib_dir /home/yjwu/petsc-3.10.1/arch-linux2-c-debug/lib<br>-- Recognized PETSc install with single library for all packages<br>-- Performing Test MULTIPASS_TEST_1_petsc_works_minimal<br>-- Performing Test MULTIPASS_TEST_1_petsc_works_minimal - Success<br>-- Minimal PETSc includes and libraries work.  This probably means we are building with shared libs.<br>-- Found PETSc: /home/yjwu/petsc-3.10.1/arch-linux2-c-debug/include;/home/yjwu/petsc-3.10.1/include (found version "3.10.1") <br>-- Configuring done<br>-- Generating done<br>-- Build files have been written to: /home/yjwu/PETSctest/Testcmake/build<br>yjwu@yjwu-XPS-8910:~/PETSctest/Testcmake/build$ make<br>Scanning dependencies of target example01cmke<br>[ 50%] Building CXX object CMakeFiles/example01cmke.dir/ex1.cpp.o<br>In file included from /home/yjwu/petsc-3.10.1/include/petscis.h:7:0,<br>                 from /home/yjwu/petsc-3.10.1/include/petscvec.h:9,<br>                 from /home/yjwu/petsc-3.10.1/include/petscmat.h:6,<br>                 from /home/yjwu/petsc-3.10.1/include/petscpc.h:6,<br>                 from /home/yjwu/petsc-3.10.1/include/petscksp.h:6,<br>                 from /home/yjwu/petsc-3.10.1/include/petscsnes.h:6,<br>                 from /home/yjwu/PETSctest/Testcmake/ex1.cpp:29:<br>/home/yjwu/petsc-3.10.1/include/petscsys.h:14:23: fatal error: petscconf.h: No such file or directory<br>compilation terminated.<br>CMakeFiles/example01cmke.dir/build.make:62: recipe for target 'CMakeFiles/example01cmke.dir/ex1.cpp.o' failed<br>make[2]: *** [CMakeFiles/example01cmke.dir/ex1.cpp.o] Error 1<br>CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/example01cmke.dir/all' failed<br>make[1]: *** [CMakeFiles/example01cmke.dir/all] Error 2<br>Makefile:83: recipe for target 'all' failed<br>make: *** [all] Error 2<br></div></blockquote></div><div>I don't know how to solve this problem,ex1.cpp is the first example in SNES tutorial, please give me some advice.</div><div><br></div><div>Best regards,</div><div>Yingjie</div></div>
</blockquote></div>