cedricboudinet / IEC61850-Explorer

Basic explorer for IEC61850 servers
GNU General Public License v3.0
12 stars 5 forks source link

How to complie on Linux? #1

Open hanusek opened 3 years ago

hanusek commented 3 years ago

Hello. How to compile on Linux (Ubuntu)?

Where to put the libiec61850 library sources? I copied them to _thirdparty/libiec61850 but the compiler doesn't see them.

libiec61850 version is 1.3.2 - released 2019-01-29.

cedricboudinet commented 3 years ago

Hi, Under Linux, you'd better compile libiec61850 and install it under /usr directories (lib, include ...), you can use cpack to generate a .deb for libiec61850. Bests

hanusek commented 8 months ago

@cedricboudinet I can't do it. Log:

mhanusek@et-0989:~/work/code/sandbox/libiec61850$ sudo make INSTALL_PREFIX=/usr/local install
mkdir -p /usr/local/include
mkdir -p /usr/local/lib
cp hal/inc/hal_time.h  hal/inc/hal_thread.h hal/inc/hal_filesystem.h hal/inc/tls_config.h hal/inc/lib_memory.h hal/inc/hal_base.h src/common/inc/libiec61850_common_api.h src/common/inc/linked_list.h src/iec61850/inc/iec61850_client.h src/iec61850/inc/iec61850_common.h src/iec61850/inc/iec61850_server.h src/iec61850/inc/iec61850_model.h src/iec61850/inc/iec61850_cdc.h src/iec61850/inc/iec61850_dynamic_model.h src/iec61850/inc/iec61850_config_file_parser.h src/mms/inc/mms_value.h src/mms/inc/mms_common.h src/mms/inc/mms_types.h src/mms/inc/mms_type_spec.h src/mms/inc/mms_client_connection.h src/mms/inc/mms_server.h src/mms/inc/iso_connection_parameters.h src/goose/goose_subscriber.h src/goose/goose_receiver.h src/goose/goose_publisher.h src/sampled_values/sv_subscriber.h src/sampled_values/sv_publisher.h src/logging/logging_api.h /usr/local/include
cp ./build/libiec61850.a /usr/local/lib
mhanusek@et-0989:~/work/code/sandbox/libiec61850$ cd ..
mhanusek@et-0989:~/work/code/sandbox$ cd IEC61850-Explorer/

mhanusek@et-0989:~/work/code/sandbox/IEC61850-Explorer/build$ cmake --build .
[  3%] Building CXX object src/CMakeFiles/iec61850Exp.dir/iec61850Exp_fun.cpp.o
In file included from /home/mhanusek/work/code/sandbox/IEC61850-Explorer/src/iec61850Exp_fun.cpp:11:
/home/mhanusek/work/code/sandbox/IEC61850-Explorer/include/iec61850Exp_fun.h:13:10: fatal error: libiec61850/sv_subscriber.h: No such file or directory
   13 | #include <libiec61850/sv_subscriber.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [src/CMakeFiles/iec61850Exp.dir/build.make:76: src/CMakeFiles/iec61850Exp.dir/iec61850Exp_fun.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:156: src/CMakeFiles/iec61850Exp.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2
mhanusek@et-0989:~/work/code/sandbox/IEC61850-Explorer/build$ 
cedricboudinet commented 8 months ago

Dear Michal Are you sure sv_subscriber.h is installed in /usr/local/include/libiec61850/ ? It seems the header file is not found by gcc Bests

Le mer. 13 déc. 2023 à 16:52, Michał Hanusek @.***> a écrit :

@cedricboudinet https://github.com/cedricboudinet I can't do it. Log:

@.:~/work/code/sandbox/libiec61850$ sudo make INSTALL_PREFIX=/usr/local install mkdir -p /usr/local/include mkdir -p /usr/local/lib cp hal/inc/hal_time.h hal/inc/hal_thread.h hal/inc/hal_filesystem.h hal/inc/tls_config.h hal/inc/lib_memory.h hal/inc/hal_base.h src/common/inc/libiec61850_common_api.h src/common/inc/linked_list.h src/iec61850/inc/iec61850_client.h src/iec61850/inc/iec61850_common.h src/iec61850/inc/iec61850_server.h src/iec61850/inc/iec61850_model.h src/iec61850/inc/iec61850_cdc.h src/iec61850/inc/iec61850_dynamic_model.h src/iec61850/inc/iec61850_config_file_parser.h src/mms/inc/mms_value.h src/mms/inc/mms_common.h src/mms/inc/mms_types.h src/mms/inc/mms_type_spec.h src/mms/inc/mms_client_connection.h src/mms/inc/mms_server.h src/mms/inc/iso_connection_parameters.h src/goose/goose_subscriber.h src/goose/goose_receiver.h src/goose/goose_publisher.h src/sampled_values/sv_subscriber.h src/sampled_values/sv_publisher.h src/logging/logging_api.h /usr/local/include cp ./build/libiec61850.a /usr/local/lib @.:~/work/code/sandbox/libiec61850$ cd .. @.***:~/work/code/sandbox$ cd IEC61850-Explorer/

@.:~/work/code/sandbox/IEC61850-Explorer/build$ cmake --build . [ 3%] Building CXX object src/CMakeFiles/iec61850Exp.dir/iec61850Exp_fun.cpp.o In file included from /home/mhanusek/work/code/sandbox/IEC61850-Explorer/src/iec61850Exp_fun.cpp:11: /home/mhanusek/work/code/sandbox/IEC61850-Explorer/include/iec61850Exp_fun.h:13:10: fatal error: libiec61850/sv_subscriber.h: No such file or directory 13 | #include <libiec61850/sv_subscriber.h> | ^~~~~~~~~ compilation terminated. gmake[2]: [src/CMakeFiles/iec61850Exp.dir/build.make:76: src/CMakeFiles/iec61850Exp.dir/iec61850Exp_fun.cpp.o] Error 1 gmake[1]: [CMakeFiles/Makefile2:156: src/CMakeFiles/iec61850Exp.dir/all] Error 2 gmake: [Makefile:166: all] Error 2 @.***:~/work/code/sandbox/IEC61850-Explorer/build$

— Reply to this email directly, view it on GitHub https://github.com/cedricboudinet/IEC61850-Explorer/issues/1#issuecomment-1854188258, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADX7TFRVWLHL2ZVESABCPGDYJHFKRAVCNFSM4XCX4GJ2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBVGQYTQOBSGU4A . You are receiving this because you were mentioned.Message ID: @.***>

hanusek commented 8 months ago

Dear Michal Are you sure sv_subscriber.h is installed in /usr/local/include/libiec61850/ ? It seems the header file is not found by gcc Bests Le mer. 13 déc. 2023 à 16:52, Michał Hanusek @.> a écrit : @cedricboudinet https://github.com/cedricboudinet I can't do it. Log: @.:~/work/code/sandbox/libiec61850$ sudo make INSTALL_PREFIX=/usr/local install mkdir -p /usr/local/include mkdir -p /usr/local/lib cp hal/inc/hal_time.h hal/inc/hal_thread.h hal/inc/hal_filesystem.h hal/inc/tls_config.h hal/inc/lib_memory.h hal/inc/hal_base.h src/common/inc/libiec61850_common_api.h src/common/inc/linked_list.h src/iec61850/inc/iec61850_client.h src/iec61850/inc/iec61850_common.h src/iec61850/inc/iec61850_server.h src/iec61850/inc/iec61850_model.h src/iec61850/inc/iec61850_cdc.h src/iec61850/inc/iec61850_dynamic_model.h src/iec61850/inc/iec61850_config_file_parser.h src/mms/inc/mms_value.h src/mms/inc/mms_common.h src/mms/inc/mms_types.h src/mms/inc/mms_type_spec.h src/mms/inc/mms_client_connection.h src/mms/inc/mms_server.h src/mms/inc/iso_connection_parameters.h src/goose/goose_subscriber.h src/goose/goose_receiver.h src/goose/goose_publisher.h src/sampled_values/sv_subscriber.h src/sampled_values/sv_publisher.h src/logging/logging_api.h /usr/local/include cp ./build/libiec61850.a /usr/local/lib @.:~/work/code/sandbox/libiec61850$ cd .. @.:~/work/code/sandbox$ cd IEC61850-Explorer/ @.:~/work/code/sandbox/IEC61850-Explorer/build$ cmake --build . [ 3%] Building CXX object src/CMakeFiles/iec61850Exp.dir/iec61850Exp_fun.cpp.o In file included from /home/mhanusek/work/code/sandbox/IEC61850-Explorer/src/iec61850Exp_fun.cpp:11: /home/mhanusek/work/code/sandbox/IEC61850-Explorer/include/iec61850Exp_fun.h:13:10: fatal error: libiec61850/sv_subscriber.h: No such file or directory 13 | #include <libiec61850/sv_subscriber.h> | ^~~~~~~~~ compilation terminated. gmake[2]: [src/CMakeFiles/iec61850Exp.dir/build.make:76: src/CMakeFiles/iec61850Exp.dir/iec61850Exp_fun.cpp.o] Error 1 gmake[1]: [CMakeFiles/Makefile2:156: src/CMakeFiles/iec61850Exp.dir/all] Error 2 gmake: [Makefile:166: all] Error 2 @.:~/work/code/sandbox/IEC61850-Explorer/build$ — Reply to this email directly, view it on GitHub <#1 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADX7TFRVWLHL2ZVESABCPGDYJHFKRAVCNFSM4XCX4GJ2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBVGQYTQOBSGU4A . You are receiving this because you were mentioned.Message ID: @.>

mhanusek@et-0989:~$ sudo ls /usr/local/include/libiec61850/ 
[sudo] password for mhanusek: 
ls: cannot access '/usr/local/include/libiec61850/': No such file or directory
mhanusek@et-0989:~$ sudo ls /usr/local/include/
goose_publisher.h   hal_thread.h       iec61850_config_file_parser.h  libiec61850_common_api.h  mms_common.h     sv_publisher.h
goose_receiver.h    hal_time.h         iec61850_dynamic_model.h       lib_memory.h      mms_server.h     sv_subscriber.h
goose_subscriber.h  iec61850_cdc.h     iec61850_model.h           linked_list.h     mms_types.h  tls_config.h
hal_base.h      iec61850_client.h  iec61850_server.h          logging_api.h     mms_type_spec.h
hal_filesystem.h    iec61850_common.h  iso_connection_parameters.h    mms_client_connection.h   mms_value.h
mhanusek@et-0989:~$ 

I will try to move it to /usr/local/include/libiec61850/

IgorLvovSpeed commented 4 months ago

Dear Colleague

Remark: I'm stupid man in Linux world. Be funny I use Virtualbox for Debian GNU/Linux 11 from https://www.osboxes.org/ I already have installed Git (Please use others instruction for do it) I have /home/osboxes/projects/test folder for check different tools You have internet for download packets. I love Total Commander and for linux use Double Commander

My step by step instruction for install IEC61850-Explorer

  1. In terminal go to folder /home/osboxes/projects/test

  2. Clone IEC61850-Explorer git clone https://github.com/cedricboudinet/IEC61850-Explorer.git Will be greated folder /home/osboxes/projects/test/IEC61850-Explorer

  3. Go to folder /IEC61850-Explorer cd IEC61850-Explorer/third_party/

  4. From FireFox browser go to page Releases and download Source code libiec61850 file version [1.3.2] released 2019-01-29. to /home/osboxes/projects/test/IEC61850-Explorer/third_party/libiec61850-1.3.2.zip Unpack archive file to /home/osboxes/projects/test/IEC61850-Explorer/third_party/libiec61850/

  5. In treminal go to home/osboxes/projects/test/IEC61850-Explorer/third_party/libiec61850/ Compile libiec61850 sudo make INSTALL_PREFIX=/usr/local install

Now in /usr/local/lib you can see libiec61850.a

And in /usr/local/include asn1_ber_primitive_value.h iso_server.h ber_integer.h libiec61850_common_api.h byte_buffer.h lib_memory.h goose_publisher.h linked_list.h goose_receiver.h logging_api.h goose_subscriber.h mms_client_connection.h hal_filesystem.h mms_common.h hal_thread.h mms_device_model.h hal_time.h mms_named_variable_list.h iec61850_cdc.h mms_server.h iec61850_client.h mms_types.h iec61850_common.h mms_type_spec.h iec61850_config_file_parser.h mms_value.h iec61850_dynamic_model.h python3.9 iec61850_model.h sv_publisher.h iec61850_server.h sv_subscriber.h iso_connection_parameters.h tls_config.h

In terminal go to folder /user/local/include and create folder /user/local/include/libiec61850/ mkdir libiec61850 Move h-files from /usr/local/include to /user/local/include/libiec61850/ mv *.h \libiec61850

  1. Copy file /home/osboxes/projcts/test/IEC61850-Explorer/third_party/libiec61850/hal/inc/hal_ethernet.h to usr/local/include/libiec61850/

  2. Compile IEC61850-Explorer project In terminal go to folder /home/osboxes/projects/test/IEC61850-Explorer

    mkdir build
    cd build
    cmake ..
    cmake --build .
[  3%] Building CXX object src/CMakeFiles/iec61850Exp.dir/iec61850Exp_fun.cpp.o
[  7%] Building CXX object src/CMakeFiles/iec61850Exp.dir/MmsValueWrapper.cpp.o
[ 11%] Linking CXX static library libiec61850Exp.a
[ 11%] Built target iec61850Exp
[ 15%] Building CXX object src/CMakeFiles/iec61850-shell.dir/iec61850-shell.cpp.o
[ 19%] Linking CXX executable iec61850-shell
[ 19%] Built target iec61850-shell
[ 23%] Building CXX object src/CMakeFiles/iec61850-scan.dir/iec61850-scan.cpp.o
[ 26%] Linking CXX executable iec61850-scan
[ 26%] Built target iec61850-scan
[ 30%] Building CXX object src/CMakeFiles/iec61850_varCmd.dir/iec61850_varCmd.cpp.o
[ 34%] Linking CXX executable iec61850_varCmd
[ 34%] Built target iec61850_varCmd
[ 38%] Building C object src/CMakeFiles/iec61850_testsrv.dir/iec61850_testsrv.c.o
[ 42%] Linking C executable iec61850_testsrv
[ 42%] Built target iec61850_testsrv
[ 46%] Building CXX object src/CMakeFiles/iec61850_svDisp.dir/iec61850_svDisp.C.o
[ 50%] Linking CXX executable iec61850_svDisp
[ 50%] Built target iec61850_svDisp
[ 53%] Automatic MOC for target iec61850-Explorer
[ 53%] Built target iec61850-Explorer_autogen
[ 57%] Generating qrc_icons.cpp
[ 61%] Building CXX object src/CMakeFiles/iec61850-Explorer.dir/iec61850-Explorer_autogen/mocs_compilation.cpp.o
[ 65%] Building CXX object src/CMakeFiles/iec61850-Explorer.dir/iec61850-Explorer.cpp.o
[ 69%] Building CXX object src/CMakeFiles/iec61850-Explorer.dir/VariablesListWindow.cpp.o
[ 73%] Building CXX object src/CMakeFiles/iec61850-Explorer.dir/ExplorerWindow.cpp.o
[ 76%] Building CXX object src/CMakeFiles/iec61850-Explorer.dir/VariablesView.cpp.o
[ 80%] Building CXX object src/CMakeFiles/iec61850-Explorer.dir/MmsTreeItem.cpp.o
[ 84%] Building CXX object src/CMakeFiles/iec61850-Explorer.dir/MmsInputDialog.cpp.o
[ 88%] Building CXX object src/CMakeFiles/iec61850-Explorer.dir/qrc_icons.cpp.o
[ 92%] Linking CXX executable iec61850-Explorer
[ 92%] Built target iec61850-Explorer
[ 96%] Building CXX object tests/CMakeFiles/test_fun.dir/test_fun.C.o
[100%] Linking CXX executable test_fun
[100%] Built target test_fun

In folder /home/osboxes/projects/test/IEC61850-Explorer/build/src you can see CMakeFiles iec61850-Explorer iec61850_svDisp Makefile cmake_install.cmake iec61850-Explorer_autogen iec61850_testsrv qrc_icons.cpp CTestTestfile.cmake iec61850-scan iec61850_varCmd icons.qrc.depends iec61850-shell libiec61850Exp.a

Using In terminal you can run Test IEC61850 Server ./iec61850_testsrv

Starting IED server Sat Apr 27 11:09:33 2024 Iec61850 test server is ready

In other terminals you can run

./iec61850-scan
./iec61850-shell
./iec61850_svDisp
./iec61850_varCmd
./iec61850-Explorer

Remark^ I don't know but ./iec61850-Explorer dont work good. I don't see testsrv.