numbbo / coco

Numerical Black-Box Optimization Benchmarking Framework
https://numbbo.github.io/coco
Other
260 stars 86 forks source link

On Mac : Library is not loaded for `test-c` #1070

Closed NDManh closed 8 years ago

NDManh commented 8 years ago

When I try to run the command : python do.py test-c on Mac, I encounter the following error :

AML ['code-experiments/src/coco_random.c', 'code-experiments/src/coco_suite.c', 'code-experiments/src/coco_observer.c', 'code-experiments/src/coco_archive.c', 'code-experiments/src/coco_runtime_c.c'] -> code-experiments/build/c/coco.c
COPY    code-experiments/src/coco.h -> code-experiments/build/c/coco.h
COPY    code-experiments/build/c/coco.c -> code-experiments/examples/bbob2009-c-cmaes/coco.c
COPY    code-experiments/build/c/coco.h -> code-experiments/examples/bbob2009-c-cmaes/coco.h
WRITE   code-experiments/build/c/REVISION
WRITE   code-experiments/build/c/VERSION
MAKE    clean in code-experiments/build/c
COPY    Makefile.in -> Makefile
MAKE    all in code-experiments/build/c
COPY    Makefile.in -> Makefile
COPY    code-experiments/test/unit-test/lib/macosx/libcmocka.dylib -> code-experiments/test/unit-test/libcmocka.dylib
COPY    code-experiments/build/c/coco.c -> code-experiments/test/unit-test/coco.c
COPY    code-experiments/src/coco.h -> code-experiments/test/unit-test/coco.h
MAKE    clean in code-experiments/test/unit-test
COPY    Makefile.in -> Makefile
MAKE    all in code-experiments/test/unit-test
COPY    Makefile.in -> Makefile
RUN ./unit_test in code-experiments/test/unit-test
ERROR: return value=-5
dyld: Library not loaded: libcmocka.0.dylib
  Referenced from: /Users/NGUYEN/Documents/Github/Largescale1/numbbo/code-experiments/test/unit-test/./unit_test
  Reason: image not found

I think that libcmocka.0.dylibshould be libcmocka.dylib but I do not know how to fix it.

dtusar commented 8 years ago

Maybe you can try the same as here #255 .

NDManh commented 8 years ago

Thanks @dtusar for your suggestion, I've tried to pursue the instruction on http://zhuyong.me/blog/2014/03/19/c-code-unit-testing-using-cmocka/ for both versions cmocka-1.0.0 and cmocka-1.0.1 but not success with the command make during the instruction. Then I've tried with the following instruction : http://macappstore.org/cmocka/ (it"s quite simple for me :-))and successfully built cmocka-1.0.1 on my machine. The command python do.py test-c works well now.

Before installing cmocka-1.0.1, I try to rename of the file libcmocka.dylib (inside the folder .../code-experiments/test/unit-test) to libcmocka.0.dylib. In this case, the command python do.py test-c also works.