Failing to set up simple test configuration

174 views
Skip to first unread message

Alex Zimmerman

unread,
Sep 7, 2016, 3:57:33 AM9/7/16
to deal.II User Group
Maybe this is a bug, but I think it's more likely that I'm doing something wrong here.

I had tried to set up a test for my user code following the instructions at https://www.dealii.org/developer/users/testsuite.html. This failed; so I attempted to set this up with step-1, using the exact CMakeLists from the "simple configuration" example and following the same steps to produce the parameter file, configure the test, and run the test.

Originally I was on my own branch of deal.II-8.5.0-pre; but now I've reproduced the same problem with the latest release, 8.4.2.

I configure, build, and run the test 

$ cd step-1
$ mkdir build
$ cd build/
$ cmake ..
 
-- Using the deal.II-8.4.2 installation found at /home/zimmerman/Installed/dealii-8.4.2
-- Include macro /home/zimmerman/Installed/dealii-8.4.2/share/deal.II/macros/macro_deal_ii_add_test.cmake
-- Include macro /home/zimmerman/Installed/dealii-8.4.2/share/deal.II/macros/macro_deal_ii_initialize_cached_variables.cmake
-- Include macro /home/zimmerman/Installed/dealii-8.4.2/share/deal.II/macros/macro_deal_ii_invoke_autopilot.cmake
-- Include macro /home/zimmerman/Installed/dealii-8.4.2/share/deal.II/macros/macro_deal_ii_pickup_tests.cmake
-- Include macro /home/zimmerman/Installed/dealii-8.4.2/share/deal.II/macros/macro_deal_ii_query_git_information.cmake
-- Include macro /home/zimmerman/Installed/dealii-8.4.2/share/deal.II/macros/macro_deal_ii_setup_target.cmake
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Autopilot invoked
###
#
#  Project  step-1  set up with  deal.II-8.4.2  found at
#      /home/zimmerman/Installed/dealii-8.4.2
#
#  CMAKE_BUILD_TYPE:          Debug
#
#  You can now run
#       $ make                - to compile and link the program
#       $ make run            - to (compile, link and) run the program
#
#       $ make debug          - to switch the build type to 'Debug'
#       $ make release        - to switch the build type to 'Release'
#
#       $ make edit_cache     - to change (cached) configuration variables
#                               and rerun the configure and generate phases of CMake
#
#       $ make strip_comments - to strip the source files in this
#                               directory off the documentation comments
#       $ make clean          - to remove the generated executable as well as
#                               all intermediate compilation files
#       $ make runclean       - to remove all output generated by the program
#       $ make distclean      - to clean the directory from _all_ generated
#                               files (includes clean, runclean and the removal
#                               of the generated build system)
#       $ make info           - to view this message again
#
#  Have a nice day!
#
###
-- Found Perl: /usr/bin/perl (found version "5.18.2")
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/Alexander/UbuntuShared/help/temp/step-1/build
zimmerman@GRS-LAPTOP:/mnt/c/Users/Alexander/UbuntuShared/help/temp/step-1/build$ make
Scanning dependencies of target step-1
[100%] Building CXX object CMakeFiles/step-1.dir/step-1.cc.o
Linking CXX executable step-1
[100%] Built target step-1
 

$ ctest
 
Test project /mnt/c/Users/Alexander/UbuntuShared/help/temp/step-1/build
    Start 1: tests/my_test.debug
1/1 Test #1: tests/my_test.debug ..............***Failed    0.59 sec
0% tests passed, 1 tests failed out of 1
Total Test time (real) =   0.60 sec
The following tests FAILED:
          1 - tests/my_test.debug (Failed)
Errors while running CTest
zimmerman@GRS-LAPTOP:/mnt/c/Users/Alexander/UbuntuShared/help/temp/step-1/build$ ctest
Test project /mnt/c/Users/Alexander/UbuntuShared/help/temp/step-1/build
    Start 1: tests/my_test.debug
1/1 Test #1: tests/my_test.debug ..............***Failed    0.60 sec
0% tests passed, 1 tests failed out of 1
Total Test time (real) =   0.60 sec
The following tests FAILED:
          1 - tests/my_test.debug (Failed)
Errors while running CTest


Then investigating the error I find

$ less Testing/Temporary/LastTest.log
 
Start testing: Sep 07 09:50 DST
----------------------------------------------------------
1/1 Testing: tests/my_test.debug
1/1 Test: tests/my_test.debug
Command: "/usr/bin/cmake" "-DTRGT=my_test.debug.diff" "-DTEST=tests/my_test.debug" "-DEXPECT=PASSED" "-DBINARY_DIR=/mnt/c/Users/Alexander/UbuntuShared/help/temp/step-1/build" "-DGUARD_FILE=/mnt/c/Users/Alexander/UbuntuShared/help/temp/step-1/build/tests/my_test.debug/interrupt_guard.cc" "-P" "/home/zimmerman/Installed/dealii-8.4.2/share/deal.II/scripts/run_test.cmake"
Directory: /mnt/c/Users/Alexander/UbuntuShared/help/temp/step-1/build/tests/my_test.debug
"tests/my_test.debug" start time: Sep 07 09:50 DST
Output:
----------------------------------------------------------
Test tests/my_test.debug: DIFF
===============================   OUTPUT BEGIN  ===============================
[ 33%] Built target step-1
[ 66%] Generating my_test.debug/output
Can't do inplace edit on /mnt/c/Users/Alexander/UbuntuShared/help/temp/step-1/build/tests/my_test.debug/output: No such file or directory.
[100%] Generating my_test.debug/diff
numdiff: output: No such file or directory
tests/my_test.debug: BUILD successful.
tests/my_test.debug: RUN successful.
tests/my_test.debug: DIFF failed. ------ Source: /mnt/c/Users/Alexander/UbuntuShared/help/temp/step-1/tests/my_test.output
tests/my_test.debug: DIFF failed. ------ Result: /mnt/c/Users/Alexander/UbuntuShared/help/temp/step-1/build/tests/my_test.debug/output
Check /mnt/c/Users/Alexander/UbuntuShared/help/temp/step-1/build/tests/my_test.debug/output /mnt/c/Users/Alexander/UbuntuShared/help/temp/step-1/tests/my_test.output
tests/my_test.debug: DIFF failed. ------ Diff:   /mnt/c/Users/Alexander/UbuntuShared/help/temp/step-1/build/tests/my_test.debug/failing_diff
tests/my_test.debug: DIFF failed. ------ First 8 lines of numdiff/diff output:
tests/my_test.debug: DIFF failed. ------ First 50 lines diff output:
/usr/bin/diff: output: No such file or directory
make[3]: *** [tests/my_test.debug/diff] Error 1
make[2]: *** [tests/CMakeFiles/my_test.debug.diff.dir/all] Error 2
make[1]: *** [tests/CMakeFiles/my_test.debug.diff.dir/rule] Error 2
make: *** [my_test.debug.diff] Error 2

tests/my_test.debug: ******    DIFF failed    *******
===============================    OUTPUT END   ===============================
Expected stage PASSED - aborting
CMake Error at /home/zimmerman/Installed/dealii-8.4.2/share/deal.II/scripts/run_test.cmake:140 (MESSAGE):
  *** abort

<end of output>
Test time =   0.60 sec
----------------------------------------------------------
Test Failed.
"tests/my_test.debug" end time: Sep 07 09:50 DST
"tests/my_test.debug" time elapsed: 00:00:00
----------------------------------------------------------
End testing: Sep 07 09:50 DST 

As I understand, the test it supposed to pipe the standard output of the program to an output file that will be compared with the test file. It appears to me that it's failing to produce this output file. I saw this exact same behavior with both versions of deal.II (8.5.0-pre and 8.4.2) that I've tried and also with both projects (my custom project and step-1). I attached the project directory, which should be nearly identical to what is shown in the "simple configuration" example.

What am I missing?

Thanks for your help!

Alex
step-1_simple_test.zip

Jean-Paul Pelteret

unread,
Sep 7, 2016, 4:05:38 AM9/7/16
to deal.II User Group
Hi Alex,

numdiff: output: No such file or directory
/usr/bin/diff: output: No such file or directory

It appears that you might be missing some of the programs necessary to check your test's output against the "blessed" result. Can you you check that you have numdiff and diff installed and in path?

Regards,
J-P

Alex Zimmerman

unread,
Sep 7, 2016, 4:07:06 AM9/7/16
to deal.II User Group
This might be a problem with my file system. I've been successfully using the Ubuntu subsystem on Windows 10 for the past few weeks, and that's where the odd "/mnt/c/Users..." path comes from in my question.

I just tried this again at my home directory, and it worked. I thought I had tried running the test on my user project in my home directory, but I'm fairly sure I never tried this simple step-1 example there.

So now this is working:

$ ctest
 
Test project /home/zimmerman/temp/step-1/build
    Start 1: tests/my_test.debug
1/1 Test #1: tests/my_test.debug ..............   Passed    5.51 sec
100% tests passed, 0 tests failed out of 1
Total Test time (real) =   5.52 sec


One of these days I'll ask a question that I don't answer myself a few minutes later :)


On Wednesday, September 7, 2016 at 9:57:33 AM UTC+2, Alex Zimmerman wrote:

Alex Zimmerman

unread,
Sep 7, 2016, 4:10:00 AM9/7/16
to deal.II User Group
Actually numdiff was already installed; I think that error was referring to the file simply not existing. See my latest reply. Thanks for your time!

Alex Zimmerman

unread,
Sep 7, 2016, 4:14:15 AM9/7/16
to deal.II User Group
I should add that I'm still quite curious as to why this problem occurs; but I don't expect anyone to want to spend time debugging an "Ubuntu on Windows" problem. This is the first issue I've had with the file system. Other outputs write perfectly fine.

Jean-Paul Pelteret

unread,
Sep 7, 2016, 4:29:54 AM9/7/16
to deal.II User Group
Great, glad that you sorted it out!

By the way, there's recently been a discussion on GitHub related to running deal.II on windows. Its interesting to hear that you've got it running on Windows 10. Out of curiosity, how have you configured deal.II? Do you link it against any external libraries?

Alex Zimmerman

unread,
Sep 7, 2016, 8:56:10 AM9/7/16
to deal.II User Group
The recent Windows 10 "Anniversary Update" included an entire built-in Ubuntu (14.04) subsystem: https://msdn.microsoft.com/en-us/commandline/wsl/about

I've built a few different versions of deal.II on this system, including the candi build with Trilinos, p4est, etc. This was all painless, so definitely try it out if you can use the latest version of Windows.

It's actually called "Bash on Ubuntu on Windows", and it's marketed as just being a bash prompt useful for command line tools; but it appears much more capable than that. Also it can read/write from/to the entire Windows C: drive, which is the "/mnt/c" path in my question. This has been useful so that I can use Notepad++ and Paraview from Windows. "Bash on Ubuntu on Windows" currently isn't very good at forwarding graphics. Even gedit doesn't forward very well. There might be some low level magic that Microsoft has performed to make all of this work. Presently it appears that my issue is related to MS-DOS not allowing my ctest to do some inline file editing on my C: drive. But this is indeed to first issue I've had, so the system looks quite promising.

After some brief Googling, I think I might even be able to fix this issue if I could find where the code is that is causing the error "Can't do inplace edit on /mnt/c/Users/Alexander/UbuntuShared/dimice-heat-dealii/build/tests/cylinder.debug/output: No such file or directory." Unfortunately I'm completely unfamiliar with the test system and I have not a clue.

Jean-Paul Pelteret

unread,
Sep 7, 2016, 9:32:34 AM9/7/16
to deal.II User Group
Hi Alex,

Great, many thanks for your useful feedback. I've alerted the other developers to your comments so that they can be considered in the discussion about getting deal.II to properly on windows.

Cheers,
J-P

Timo Heister

unread,
Sep 7, 2016, 12:44:09 PM9/7/16
to dea...@googlegroups.com
Hey Alex,

I am not surprised you are running into issues, because you are the
first one to try "ubuntu on windows" to compile deal.II with (at least
as far as I know).

It could be a permission problem that you are running into, who knows.
Would you mind sharing you deal.II detailed.log?

On Wed, Sep 7, 2016 at 9:32 AM, Jean-Paul Pelteret <jppel...@gmail.com> wrote:
> Hi Alex,
>
> Great, many thanks for your useful feedback. I've alerted the other
> developers to your comments so that they can be considered in the discussion
> about getting deal.II to properly on windows.
>
> Cheers,
> J-P
>
>
> On Wednesday, September 7, 2016 at 2:56:10 PM UTC+2, Alex Zimmerman wrote:
>>
>> The recent Windows 10 "Anniversary Update" included an entire built-in
>> Ubuntu (14.04) subsystem:
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en-2Dus_commandline_wsl_about&d=CwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=WDpmF-SkGP5uKyQ0vKXcggIG-I_RfG1fLlDteZEDQ_s&s=iVn3ecqjKuFP2DxDo7Q8ippSqeZvU8HaFT57rzJEvRQ&e=
>>>>> instructions at https://urldefense.proofpoint.com/v2/url?u=https-3A__www.dealii.org_developer_users_testsuite.html&d=CwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=WDpmF-SkGP5uKyQ0vKXcggIG-I_RfG1fLlDteZEDQ_s&s=D427W_TuNHmLUNLsfAJzev5TqwE4D65e65adR2s4VMo&e= . This
> --
> The deal.II project is located at https://urldefense.proofpoint.com/v2/url?u=http-3A__www.dealii.org_&d=CwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=WDpmF-SkGP5uKyQ0vKXcggIG-I_RfG1fLlDteZEDQ_s&s=_ipsTgpuaBmXBG8G4FbL5JQFGCxifqtLmh2pzQ07qIk&e=
> For mailing list/forum options, see
> https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_forum_dealii-3Fhl-3Den&d=CwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=WDpmF-SkGP5uKyQ0vKXcggIG-I_RfG1fLlDteZEDQ_s&s=DMcY2S9-vF393PESonsZZXSuSrNEiUFJmAwz5AiwosU&e=
> ---
> You received this message because you are subscribed to the Google Groups
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dealii+un...@googlegroups.com.
> For more options, visit https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout&d=CwIBaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw&m=WDpmF-SkGP5uKyQ0vKXcggIG-I_RfG1fLlDteZEDQ_s&s=JW7b9LlJor5LNkwWJ0IXyxUv64V0bnSE1P5qDUsiEFQ&e= .



--
Timo Heister
http://www.math.clemson.edu/~heister/

Matthias Maier

unread,
Sep 7, 2016, 1:16:39 PM9/7/16
to dea...@googlegroups.com

On Wed, Sep 7, 2016, at 11:43 CDT, Timo Heister <hei...@clemson.edu> wrote:

> Hey Alex,
>
> I am not surprised you are running into issues, because you are the
> first one to try "ubuntu on windows" to compile deal.II with (at least
> as far as I know).
>
> It could be a permission problem that you are running into, who knows.
> Would you mind sharing you deal.II detailed.log?

I am very exited that this works.

I will give it a try sometime later this week - maybe I can reproduce.

Best,
Matthias

Wolfgang Bangerth

unread,
Sep 7, 2016, 4:36:21 PM9/7/16
to dea...@googlegroups.com
On 09/07/2016 06:56 AM, Alex Zimmerman wrote:
>
> After some brief Googling, I think I might even be able to fix this issue if I
> could find where the code is that is causing the error "Can't do inplace edit
> on
> /mnt/c/Users/Alexander/UbuntuShared/dimice-heat-dealii/build/tests/cylinder.debug/output:
> No such file or directory." Unfortunately I'm completely unfamiliar with the
> test system and I have not a clue.

This happens in cmake/macros/macro_deal_ii_add_test.cmake, around line 240:

ADD_CUSTOM_COMMAND(OUTPUT ${_test_directory}/output
COMMAND sh ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.sh
run "${_test_full}" "${_run_command}" "${_test_diff}"
"${DIFF_EXECUTABLE}" "${_comparison_file}"
COMMAND ${PERL_EXECUTABLE}
-pi ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/normalize.pl
${_test_directory}/output
WORKING_DIRECTORY
${_test_directory}
DEPENDS
${_target}
${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/normalize.pl
VERBATIM
)

We here call "perl -pi <normalize-script> <output-file>".

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Alex Zimmerman

unread,
Sep 16, 2016, 12:21:48 PM9/16/16
to deal.II User Group, bang...@colostate.edu
Wolfgang, thanks for pointing me to this part of the code. I'm not sure when I'll try to fix the problem, because it was very simple to just only ever run ctest on the Linux filesystem, completely circumventing it. I'll make sure to post an update if I ever fix this so that I can run ctest on the Windows filesystem (from the bash prompt).

Alex Zimmerman

unread,
Sep 16, 2016, 12:27:11 PM9/16/16
to deal.II User Group
Timo, when I looked into this before posting my question, it seemed to be a pretty clear issue with the perl command not working on the Windows filesystem. Per my recent reply to Wolfgang, I have moved forward with a simple work-around (which simply does not involve running ctest on the Windows file system). I imagine at some point in the not-so-distant future I'll be interested in fixing this. Of course please do let me know if you're interested and want to to reproduce the log for the group's purposes.

Thanks.
Reply all
Reply to author
Forward
0 new messages