Coder Social home page Coder Social logo

Problem about buliding about turgon HOT 14 CLOSED

 avatar commented on July 3, 2024
Problem about buliding

from turgon.

Comments (14)

yungyuc avatar yungyuc commented on July 3, 2024

@yufang-hu could you post the error log here?

from turgon.

 avatar commented on July 3, 2024

圖片

and then

圖片

from turgon.

yungyuc avatar yungyuc commented on July 3, 2024

It is not a good way to post image for textual log. Any further processing requires typing by the image. I cannot quote and respond where there is an issue. Please use mark-down format to post the original textual message next time.

None of xtl, xsimd, xtensor, and xtensor-python is found. Where do you install those headers to?

from turgon.

 avatar commented on July 3, 2024

I got your advice. Thanks a lot.
I install those packages using conda ,and they are all intstalled to the path /Users/huyufang/anaconda3/envs/turgon/include.
Following is the error log.

-- BUILD_GTESTS: ON
-- HIDE_SYMBOL: OFF
-- DEBUG_SYMBOL: ON
-- not use clang-tidy
-- pybind11_INCLUDE_DIRS: /Users/huyufang/anaconda3/envs/turgon/include/python3.7m;/Users/huyufang/anaconda3/envs/turgon/include/python3.7m
-- NUMPY_INCLUDE_DIR: /Users/huyufang/anaconda3/envs/turgon/lib/python3.7/site-packages/numpy/core/include
-- xtl_INCLUDE_DIR: not found
-- xsimd_INCLUDE_DIR: not found
-- xtensor_INCLUDE_DIR: not found
-- xtensor-python_INCLUDE_DIR: not found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/huyufang/Desktop/turgon/spacetime/gtests/googletest-download
[100%] Built target googletest
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/huyufang/Desktop/turgon/spacetime

from turgon.

yungyuc avatar yungyuc commented on July 3, 2024

Thanks for updating the textual log. Have you tried to give cmake the path hint, e.g., https://github.com/yungyuc/turgon/blob/master/spacetime/cmake/Findxtl.cmake#L9 ? It can be provided through cmake command line like cmake -Dxtl_ROOT=/where/you/install/xtl.

from turgon.

 avatar commented on July 3, 2024

It seems that I have successfully build it.

$ make
[ 25%] Built target _libst
[ 50%] Built target gtest
[ 75%] Built target gtest_main
[100%] Built target libst_gtests

then I run libst_gtests

$ ./libst_gtests
[==========] Running 3 tests from 2 test cases.
[----------] Global test environment set-up.
[----------] 2 tests from CopyTest
[ RUN      ] CopyTest.Grid
[       OK ] CopyTest.Grid (0 ms)
[ RUN      ] CopyTest.Solver
[       OK ] CopyTest.Solver (0 ms)
[----------] 2 tests from CopyTest (0 ms total)

[----------] 1 test from SolverTest
[ RUN      ] SolverTest.Celm
[       OK ] SolverTest.Celm (0 ms)
[----------] 1 test from SolverTest (0 ms total)

[----------] Global test environment tear-down
[==========] 3 tests from 2 test cases ran. (0 ms total)
[  PASSED  ] 3 tests.

I'm not sure whether I do the wrong step.
Can I ask the proper steps to build this project?

from turgon.

yungyuc avatar yungyuc commented on July 3, 2024

In the Makefile in spacetime/, there are 2 targets for testing: gtest and pytest (test depends on both). Could you please run both and see the results? If both pass then you are doing it correctly.

After that we should arrange a lecture for the premise of the CESE method for you to start hacking.

from turgon.

 avatar commented on July 3, 2024

So is it means that the Makefile in spacetime/ will create 2 target call gtest and pytest and I will see two executable file and I should run them respectively?
But after I make I just see one executable file called libst_gtests in spacetime/gtests/and it run as my previously paste.
Have I done gtest part?

from turgon.

yungyuc avatar yungyuc commented on July 3, 2024

The Makefile has two targets. But it is not accurate to say it creates two targets. And, although gtest has a corresponding executable, pytest does not. pytest uses a Python extension module, which is a shared library.

You did the gtest part. But you had the pytest missing.

from turgon.

 avatar commented on July 3, 2024

I see _libst.cpython-37m-darwin.so in spacename/. I think it is the python extension module I need if I want to run the five python files in tests/ because they all import libst.
When I run pytest it come out the error:

ImportError while importing test module '/Users/huyufang/Desktop/turgon/spacetime/tests/test_celm_selm.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_celm_selm.py:8: in <module>
    import libst
E   ModuleNotFoundError: No module named 'libst'

Then I move _libst.cpython-37m-darwin.so to tests/ but it still doesn't work.
I think it might be problem in the filename so I move out the _ at the beginning of _libst.cpython-37m-darwin.so although I don't know if it is appropriate to do that and then try to run it again, it come out another error:

ImportError while importing test module '/Users/huyufang/Desktop/turgon/spacetime/tests/test_celm_selm.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_celm_selm.py:8: in <module>
    import libst
E   ImportError: dynamic module does not define module export function (PyInit_libst)

How can I solve this problem?

from turgon.

yungyuc avatar yungyuc commented on July 3, 2024

Please print your exact commands and output for running pytest. If you literally executed pytest, you should get that error message, because of the way Python3 discovers modules. The fix is easy.

from turgon.

 avatar commented on July 3, 2024

Here is the commands and output for running pytest on test_celm_selm.py
Now _libst.cpython-37m-darwin.so is in spacetime/

$pytest tests/test_celm_selm.py

============================= test session starts ==============================
platform darwin -- Python 3.7.5, pytest-5.2.4, py-1.8.0, pluggy-0.13.0
rootdir: /Users/huyufang/Desktop/turgon/spacetime
collected 0 items / 1 errors

==================================== ERRORS ====================================
___________________ ERROR collecting tests/test_celm_selm.py ___________________
ImportError while importing test module '/Users/huyufang/Desktop/turgon/spacetime/tests/test_celm_selm.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_celm_selm.py:8: in <module>
    import libst
E   ModuleNotFoundError: No module named 'libst'
=============================== warnings summary ===============================
tests/test_celm_selm.py:101
  /Users/huyufang/Desktop/turgon/spacetime/tests/test_celm_selm.py:101: DeprecationWarning: invalid escape sequence \(
    "Celm\(xindex=2\)::move_at\(offset=-1\): xindex = 1 "

tests/test_celm_selm.py:102
  /Users/huyufang/Desktop/turgon/spacetime/tests/test_celm_selm.py:102: DeprecationWarning: invalid escape sequence \[
    "outside the interval \[2, 23\)",

tests/test_celm_selm.py:109
  /Users/huyufang/Desktop/turgon/spacetime/tests/test_celm_selm.py:109: DeprecationWarning: invalid escape sequence \(
    "Celm\(xindex=22\)::move_at\(offset=1\): xindex = 23 "

tests/test_celm_selm.py:110
  /Users/huyufang/Desktop/turgon/spacetime/tests/test_celm_selm.py:110: DeprecationWarning: invalid escape sequence \[
    "outside the interval \[2, 23\)",

tests/test_celm_selm.py:244
  /Users/huyufang/Desktop/turgon/spacetime/tests/test_celm_selm.py:244: DeprecationWarning: invalid escape sequence \(
    "Selm\(xindex=1\)::move_at\(offset=-1\): xindex = 0 "

tests/test_celm_selm.py:245
  /Users/huyufang/Desktop/turgon/spacetime/tests/test_celm_selm.py:245: DeprecationWarning: invalid escape sequence \[
    "outside the interval \[1, 24\)",

tests/test_celm_selm.py:252
  /Users/huyufang/Desktop/turgon/spacetime/tests/test_celm_selm.py:252: DeprecationWarning: invalid escape sequence \(
    "Selm\(xindex=23\)::move_at\(offset=1\): xindex = 24 "

tests/test_celm_selm.py:253
  /Users/huyufang/Desktop/turgon/spacetime/tests/test_celm_selm.py:253: DeprecationWarning: invalid escape sequence \[
    "outside the interval \[1, 24\)",

-- Docs: https://docs.pytest.org/en/latest/warnings.html
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
========================= 8 warnings, 1 error in 1.14s =========================

from turgon.

yungyuc avatar yungyuc commented on July 3, 2024

You should type

make pytest

This is the output on my machine:

$ make pytest
env PYTHONPATH=/Users/yungyuc/hack/code/turgon/spacetime /Users/yungyuc/hack/usr/opt37_190418/bin/pytest  tests/
==================================================================== test session starts =====================================================================
platform darwin -- Python 3.7.4+, pytest-4.4.1, py-1.8.0, pluggy-0.9.0
rootdir: /Users/yungyuc/hack/code/turgon/spacetime
collected 51 items

tests/test_celm_selm.py .............................                                                                                                  [ 56%]
tests/test_grid.py ....                                                                                                                                [ 64%]
tests/test_inviscid_burgers.py ..                                                                                                                      [ 68%]
tests/test_linear_scalar.py ......                                                                                                                     [ 80%]
tests/test_solution.py ..........                                                                                                                      [100%]

================================================================= 51 passed in 0.36 seconds ==================================================================

The trick is, Python 3 doesn't automatically search the current directory for modules if . isn't in PYTHONPATH.

from turgon.

 avatar commented on July 3, 2024

I see the target pytest in the original Makefile in spacetime/.
After I build it on my machine, the Makefile it create will replace the original one, and there is no target pytest in it (but target gtest is in). I don't know why.
But I think I can deal with this problem later.
I add ~/turgon/spacetime/ to PATHONPATH and successfully pass the tests!

$ pytest tests
============================= test session starts ==============================
platform darwin -- Python 3.7.5, pytest-5.2.4, py-1.8.0, pluggy-0.13.0
rootdir: /Users/huyufang/Desktop/turgon/spacetime
collected 51 items

tests/test_celm_selm.py .............................                    [ 56%]
tests/test_grid.py ....                                                  [ 64%]
tests/test_inviscid_burgers.py ..                                        [ 68%]
tests/test_linear_scalar.py ......                                       [ 80%]
tests/test_solution.py ..........                                        [100%]

============================== 51 passed in 0.65s ==============================

from turgon.

Related Issues (16)

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.