<div dir="ltr">Hi Stefano,<div><br></div><div>Thanks for your comment. Now, cmake was able to locate FindPETSc.cmake file in my project directory, but I see a new error. </div><div><br></div><div>Evan</div><div><br></div><div><br></div><div>Messages</div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">----------------------------------------------</span><br></div><div><div>/home/evan/opt/clion-2018.1.2/bin/cmake/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /home/evan/CLionProjects/hellopetsc</div><div>CMake Error at FindPETSc.cmake:123 (include):</div><div>  include could not find load file:</div><div><br></div><div>    FindPackageMultipass</div><div>Call Stack (most recent call first):</div><div>  CMakeLists.txt:10 (find_package)</div><div><br></div><div><br></div><div>CMake Error at FindPETSc.cmake:124 (find_package_multipass):</div><div>  Unknown CMake command "find_package_multipass".</div><div>Call Stack (most recent call first):</div><div>  CMakeLists.txt:10 (find_package)</div><div><br></div><div><br></div><div>-- Configuring incomplete, errors occurred!</div><div>See also "/home/evan/CLionProjects/hellopetsc/cmake-build-debug/CMakeFiles/CMakeOutput.log".</div><div>See also "/home/evan/CLionProjects/hellopetsc/cmake-build-debug/CMakeFiles/CMakeError.log".</div><div>----------------------------------------------</div></div><div><br></div><div>CMakeLists.txt</div><div>----------------------------------------------</div><div><div>/home/evan/opt/clion-2018.1.2/bin/cmake/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /home/evan/CLionProjects/hellopetsc</div><div>CMake Error at FindPETSc.cmake:123 (include):</div><div>  include could not find load file:</div><div><br></div><div>    FindPackageMultipass</div><div>Call Stack (most recent call first):</div><div>  CMakeLists.txt:10 (find_package)</div><div><br></div><div><br></div><div>CMake Error at FindPETSc.cmake:124 (find_package_multipass):</div><div>  Unknown CMake command "find_package_multipass".</div><div>Call Stack (most recent call first):</div><div>  CMakeLists.txt:10 (find_package)</div><div><br></div><div><br></div><div>-- Configuring incomplete, errors occurred!</div><div>See also "/home/evan/CLionProjects/hellopetsc/cmake-build-debug/CMakeFiles/CMakeOutput.log".</div><div>See also "/home/evan/CLionProjects/hellopetsc/cmake-build-debug/CMakeFiles/CMakeError.log".</div><div><br></div><div>[Finished]</div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 11, 2018 at 11:34 AM, Stefano Zampini <span dir="ltr"><<a href="mailto:stefano.zampini@gmail.com" target="_blank">stefano.zampini@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">CMAKE is case sensitive on this. You should use find_package(PETSc ….)<br>
<span class=""><br>
<br>
> On May 11, 2018, at 9:28 PM, Evan Um <<a href="mailto:evanum@gmail.com">evanum@gmail.com</a>> wrote:<br>
> <br>
> Hi,<br>
> <br>
> I would like to ask a question about FindPETSc.cmake. I place the cmake file in the same directory where main.cpp is placed. I also placed the file in /usr/share/cmake_xx/Modules.<br>
<br>
</span>Actually, it can be put in any directory pointed by the variable CMAKE_MODULE_PATH. If I were you, I would not modify /usr/share/ <br>
<div class="HOEnZb"><div class="h5"><br>
> Where should i put the file? What else should I do to use the file in cmake? Do I need any other lines in my cmakelists.txt except find_package(petsc)? Thanks for your comments.<br>
> <br>
> Evan<br>
> <br>
> ------------------------------<wbr>------------------------------<wbr>-<br>
> <br>
> cmake_minimum_required(VERSION 3.10)<br>
> <br>
> project(hellopetsc)<br>
> <br>
> SET(CMAKE_CXX_STANDARD 11)<br>
> SET(CMAKE_C_COMPILER mpicc)<br>
> SET(CMAKE_CXX_COMPILER mpicxx)<br>
> <br>
> find_package(PETSC COMPONENTS CXX)<br>
> <br>
> add_executable(hellopetsc main.cpp)<br>
> <br>
> ------------------------------<wbr>------------------------------<br>
> CMake Warning at CMakeLists.txt:9 (find_package):<br>
>   By not providing "FindPETSC.cmake" in CMAKE_MODULE_PATH this project has<br>
>   asked CMake to find a package configuration file provided by "PETSC", but<br>
>   CMake did not find one.<br>
> <br>
>   Could not find a package configuration file provided by "PETSC" with any of<br>
>   the following names:<br>
> <br>
>     PETSCConfig.cmake<br>
>     petsc-config.cmake<br>
> <br>
>   Add the installation prefix of "PETSC" to CMAKE_PREFIX_PATH or set<br>
>   "PETSC_DIR" to a directory containing one of the above files.  If "PETSC"<br>
>   provides a separate development package or SDK, be sure it has been<br>
>   installed.<br>
<br>
</div></div></blockquote></div><br></div>