Error while building SDK
#1
Hello! I checked existing threads but did not find a solution for my problem. 
I've already installed simple runtime and executed expample "hello" successfully. 
While I was installing SDK, I had some problems. I just follow the steps in 
GitHub and run the "make build-pulp-sdk" and some errors just came out.


Environment:
CentOS-7
gcc 4.8.3
python 3.6.8

Following is some of the configuration in my ".bashrc". 
export PATH=$PATH:$HOME/mylib/v1.0.16-pulp-riscv-gcc-centos-7/:/tools/linux/mentor/modelsim/10.6a/modeltech/

I wrote this "source_pulp.sh" and source it once before I start building SDK.
PULP_HOME=$HOME/pulpissimo
export PULP_RISCV_GCC_TOOLCHAIN=$HOME/mylib/v1.0.16-pulp-riscv-gcc-centos-7
export VSIM_PATH=$PULP_HOME/sim
export CPLUS_INCLUDE_PATH=/usr/local/include/ImageMagick-6
source $PULP_HOME/pulp-runtime/configs/pulpissimo.sh
source $PULP_HOME/setup/vsim.sh
source $PULP_HOME/pulp-sdk/configs/pulpissimo.sh
source $PULP_HOME/pulp-sdk/configs/platform-rtl.sh


1. I've already installed configparser at /usr/local/lib/python3.6/site-packages.
   But "No module named configparser" shows up from time to time. Should I install 
   configparser with another method or just run several times to ignore the error?

2. I've installed ImageMagick at /usr/local/include. When I use ImageMagick-7 as
   the library, this error occurs.

      sdk:dpi-models:build: make build install
      make[2]: Entering directory `/users/student/mr109/cyyang20/pulpissimo/pulp-sdk/platform/dpi_models'
      make -C models build
      make[3]: Entering directory `/users/student/mr109/cyyang20/pulpissimo/pulp-sdk/platform/dpi_models/models'
      g++ camera/camera.cpp -o /users/student/mr109/cyyang20/pulpissimo/pulp-sdk/build/sdk/dpi-models/models/camera.so -I/usr/include/GraphicsMagick   -D__MAGICK__ -MMD -MP -O2 -g -fpic -std=c++11 -I/users/student/mr109/cyyang20/pulpissimo/pulp-sdk/pkg/sdk/dev/install/ws/include -Werror -Wfatal-errors -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -lGraphicsMagick++ -lGraphicsMagick -O2 -g -shared -L/users/student/mr109/cyyang20/pulpissimo/pulp-sdk/pkg/sdk/dev/install/ws/lib -Werror -Wfatal-errors
      camera/camera.cpp:82:3: error: 'PixelPacket' does not name a type
         PixelPacket *image_buffer;
         ^
      compilation terminated due to -Wfatal-errors.
      make[3]: *** [/users/student/mr109/cyyang20/pulpissimo/pulp-sdk/build/sdk/dpi-models/models/camera.so] Error 1
      make[3]: Leaving directory `/users/student/mr109/cyyang20/pulpissimo/pulp-sdk/platform/dpi_models/models'
      make[2]: *** [build] Error 2
      make[2]: Leaving directory `/users/student/mr109/cyyang20/pulpissimo/pulp-sdk/platform/dpi_models'
      Reached EOF with exit status 2
      FATAL ERROR: the command 'build' has failed
      make[1]: *** [all] Error 255
      make[1]: Leaving directory `/users/student/mr109/cyyang20/pulpissimo/pulp-sdk'
      make: *** [pulp-sdk] Error 2

   But after I choose ImageMagick-6 as the library, this error occurs.

      sdk:dpi-models:build: make build install
      make[2]: Entering directory `/users/student/mr109/cyyang20/pulpissimo/pulp-sdk/platform/dpi_models'
      make -C models build
      make[3]: Entering directory `/users/student/mr109/cyyang20/pulpissimo/pulp-sdk/platform/dpi_models/models'
      g++ camera/camera.cpp -o /users/student/mr109/cyyang20/pulpissimo/pulp-sdk/build/sdk/dpi-models/models/camera.so -I/usr/include/GraphicsMagick   -D__MAGICK__ -MMD -MP -O2 -g -fpic -std=c++11 -I/users/student/mr109/cyyang20/pulpissimo/pulp-sdk/pkg/sdk/dev/install/ws/include -Werror -Wfatal-errors -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -lGraphicsMagick++ -lGraphicsMagick -O2 -g -shared -L/users/student/mr109/cyyang20/pulpissimo/pulp-sdk/pkg/sdk/dev/install/ws/lib -Werror -Wfatal-errors
      In file included from /usr/include/GraphicsMagick/magick/render.h:14:0,
                     from /usr/include/GraphicsMagick/magick/draw.h:31,
                     from /usr/local/include/ImageMagick-6/magick/annotate.h:21,
                     from /usr/local/include/ImageMagick-6/magick/MagickCore.h:80,
                     from /usr/local/include/ImageMagick-6/Magick++/Include.h:45,
                     from /usr/local/include/ImageMagick-6/Magick++.h:10,
                     from camera/camera.cpp:24:
      /usr/include/GraphicsMagick/magick/type.h:87:21: error: 'MagickPassFail' does not name a type
      extern MagickExport MagickPassFail
                           ^
      compilation terminated due to -Wfatal-errors.
      make[3]: *** [/users/student/mr109/cyyang20/pulpissimo/pulp-sdk/build/sdk/dpi-models/models/camera.so] Error 1
      make[3]: Leaving directory `/users/student/mr109/cyyang20/pulpissimo/pulp-sdk/platform/dpi_models/models'
      make[2]: *** [build] Error 2
      make[2]: Leaving directory `/users/student/mr109/cyyang20/pulpissimo/pulp-sdk/platform/dpi_models'
      Reached EOF with exit status 2
      FATAL ERROR: the command 'build' has failed
      make[1]: *** [all] Error 255
      make[1]: Leaving directory `/users/student/mr109/cyyang20/pulpissimo/pulp-sdk'
      make: *** [pulp-sdk] Error 2

I would like to know whether I installed ImageMagick correctly. If there's 
anything needed to help me deal with these problems, please let me know! 
Thanks a lot!
Reply
#2
You should link against graphicsmagick, not imagemagick
Reply
#3
(09-11-2020, 01:18 PM)bluewww Wrote: You should link against graphicsmagick, not imagemagick

Thanks for your reply! I have built SDK successfully without any error but with several warnings. 

I'll keep trying what pulpissimo platform can do later. Besides, I think I could elaborate what happened for those having similar problems.

I installed GraphicsMagick in my home directory and add the path to $CPLUS_INCLUDE_PATH. Then I encountered the problem "/usr/bin/ld : cannot find -lGrphicsMagick++".  I didn't find libGraphicsMagick.so nor libGraphicsMagick++.so. But I  found libGraphicsMagick.so in /usr/lib64. I added /usr/lib64 into $LD_LIBRARY_PATH. The problem was not solved.

Then I found my machine only installed GraphicsMagick-devel but not GraphcisMagick-c++-devel. After installing it, the SDK was built successfully.

To sum up,
1. Install GraphicsMagick but not ImageMagick
2. Install both GraphicsMagick-devel and GraphicsMagick-c++-devel
3. Remember to add corresponding path into $CPLUS_INCLUDE_PATH and $LD_LIBRARY_PATH

I am not so sure which step is redundant. I'll be glad to learn these knowledge if you would like to share with me! Thanks a lot!
Reply
#4
You should not set $CPLUS_INCLUDE_PATH nor $LD_LIBRARY_PATH when linking against system libraries. When passing -lGrphicsMagick++ the linking should work out of the box on centos7. But if you really properly copy pasted the error message, then it looks to me like the error is due to a spelling error (Grphics instead of Graphics).
Reply
#5
Yes, it's my spelling error. (Graphics, not Grphics)
I tried to comment out the lines setting $CPLUS_INCLUDE_PATH and $LD_LIBRARY_PATH in .bashrc and did "make clean" and "make build-pulp-sdk" again. There was no error. So could I conclude that this error is because GraphicsMagick-c++-devel was not installed?
Reply


Forum Jump: