Open yw5aj opened 6 years ago
Remove the CMakeCache.txt file. You have a problem because you first configured the test and then moved the directory. Because of that all the paths are wrong. You need to remove CMakeCache.txt in order to do a clean configure.
@Rombur Thank you Rombur for your response! Yes I tried that already and posted it in the first message, but I failed to explain it clearly enough (I did not break them up into sub paragraphs). Apologies for the confusion.
At first I did forget to remove the CMakeCache.txt
:
dealii@d0e24c0315a5:~/dealii-v8.5.1-src/examples/step-1$ cp -r ~/dealii-v8.5.1-src/examples ~/shared/examples
dealii@d0e24c0315a5:~/dealii-v8.5.1-src/examples/step-1$ cd ~/shared/examples/step-1
dealii@d0e24c0315a5:~/shared/examples/step-1$ cmake CMakeLists.txt
CMake Error: The current CMakeCache.txt directory /home/dealii/shared/examples/step-1/CMakeCache.txt is different than the directory /home/dealii/dealii-v8.5.1-src/examples/step-1 where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
CMake Error: The source "/home/dealii/shared/examples/step-1/CMakeLists.txt" does not match the source "/home/dealii/dealii-v8.5.1-src/examples/step-1/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.
So I removed all those files except for the step-1.cc
and the CMakeLists.txt
:
dealii@d0e24c0315a5:~/shared/examples/step-1$ ls | grep -v 'CMakeLists.txt\|step-1.cc' | xargs rm -rf
dealii@d0e24c0315a5:~/shared/examples/step-1$ ls
CMakeLists.txt step-1.cc
And then I re-ran the cmake
command, and encountered an issue where mpicc
is not working:
dealii@d0e24c0315a5:~/shared/examples/step-1$ cmake CMakeLists.txt
-- The C compiler identification is GNU 6.2.0
-- The CXX compiler identification is GNU 6.2.0
-- Check for working C compiler: /usr/bin/mpicc
-- Check for working C compiler: /usr/bin/mpicc -- broken
CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/usr/bin/mpicc" is not able to compile a simple test
program.
It fails with the following output:
Change Dir: /home/dealii/shared/examples/step-1/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_f6b04/fast"
make: *** No rule to make target 'cmTC_f6b04/fast'. Stop.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:38 (PROJECT)
-- Configuring incomplete, errors occurred!
See also "/home/dealii/shared/examples/step-1/CMakeFiles/CMakeOutput.log".
See also "/home/dealii/shared/examples/step-1/CMakeFiles/CMakeError.log".
remove also the directory CMakeFiles…
L.
On 23 Mar 2018, at 16:14, Yuxiang Wang notifications@github.com wrote:
@Rombur Thank you Rombur for your response! Yes I tried that already and posted it in the first message, but I failed to explain it clearly enough. Apologies for the confusion.
At first I did forget to remove the CMakeCache.txt:
dealii@d0e24c0315a5:~/dealii-v8.5.1-src/examples/step-1$ cp -r ~/dealii-v8.5.1-src/examples ~/shared/examples dealii@d0e24c0315a5:~/dealii-v8.5.1-src/examples/step-1$ cd ~/shared/examples/step-1 dealii@d0e24c0315a5:~/shared/examples/step-1$ cmake CMakeLists.txt CMake Error: The current CMakeCache.txt directory /home/dealii/shared/examples/step-1/CMakeCache.txt is different than the directory /home/dealii/dealii-v8.5.1-src/examples/step-1 where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt CMake Error: The source "/home/dealii/shared/examples/step-1/CMakeLists.txt" does not match the source "/home/dealii/dealii-v8.5.1-src/examples/step-1/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.
So I removed all those files except for the step-1.cc and the CMakeLists.txt:
dealii@d0e24c0315a5:~/shared/examples/step-1$ ls | grep -v 'CMakeLists.txt|step-1.cc' | xargs rm -rf dealii@d0e24c0315a5:~/shared/examples/step-1$ ls CMakeLists.txt step-1.cc
And then I re-ran the cmake command, and encountered an issue where mpicc is not working:
dealii@d0e24c0315a5:~/shared/examples/step-1$ cmake CMakeLists.txt -- The C compiler identification is GNU 6.2.0 -- The CXX compiler identification is GNU 6.2.0 -- Check for working C compiler: /usr/bin/mpicc -- Check for working C compiler: /usr/bin/mpicc -- broken CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message): The C compiler "/usr/bin/mpicc" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/dealii/shared/examples/step-1/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_f6b04/fast"
make: *** No rule to make target 'cmTC_f6b04/fast'. Stop.
CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:38 (PROJECT)
-- Configuring incomplete, errors occurred! See also "/home/dealii/shared/examples/step-1/CMakeFiles/CMakeOutput.log". See also "/home/dealii/shared/examples/step-1/CMakeFiles/CMakeError.log".
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
@luca-heltai Thanks for you response! Yes I did - I only left step-1.cc
and CMakeLists.txt
, by running ls | grep -v 'CMakeLists.txt\|step-1.cc' | xargs rm -rf
. And the mpicc
still failed.
is the directory writeable by you?
@luca-heltai Thank you for the quick response.
1) Yes I do - I tried the following:
dealii@4672ffbca33e:~/shared/examples/step-1$ touch test.txt
dealii@4672ffbca33e:~/shared/examples/step-1$ ls
CMakeLists.txt step-1.cc test.txt
2) I had the same question yesterday, because in the CMakeError.log
I read the following lines:
Determining if the C compiler works failed with the following output:
Change Dir: /home/dealii/shared/examples/step-1/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_a147c/fast"
make: *** No rule to make target 'cmTC_a147c/fast'. Stop.
Mmmm... it seems like it does not create directories. Can you create directories?
@luca-heltai Yes I feel the same way - it seems like it failed to create cmTC_a147c/fast. However, it did create all the other folders like CMakeFiles, CMakeTmp. Also, I tried the following:
dealii@4672ffbca33e:~/shared/examples/step-1$ ls
CMakeLists.txt step-1.cc
dealii@4672ffbca33e:~/shared/examples/step-1$ mkdir testdir
dealii@4672ffbca33e:~/shared/examples/step-1$ cd testdir
dealii@4672ffbca33e:~/shared/examples/step-1/testdir$ touch test.txt
dealii@4672ffbca33e:~/shared/examples/step-1/testdir$ ls
test.txt
dealii@4672ffbca33e:~/shared/examples/step-1/testdir$ cd ..
dealii@4672ffbca33e:~/shared/examples/step-1$ ls
CMakeLists.txt step-1.cc testdir
Maybe this could help to debug it. https://intellij-support.jetbrains.com/hc/en-us/community/posts/207460115/comments/360002077699
Short summary: cmake runs examples fine when I run it in the pre-installed src example folder, but not after I copied it to ~/shared. Could you please help see why?
Full story: first, when I run it in the pre-installed src example folder, it works:
However, if I copy the examples to my local folder, it wouldn't work. (Edit on 3/23 - removed the confusion parts of the code where I forgot to clean the old cmake file first)
(I cleaned the folder and then copied the
examples
to~/shared/examples
)Could you please help?
Thank you, Shawn