Hi Claes,
A custom class references the atlas library (automatically tuned linear algebra software), found here: math-atlas.sourceforge.net
This C program references the following include files:
#include <stdio.h>
#include <atlas_enum.h>
#include "clapack.h"
void SCREEN_exec(plc_sThread *tp, pwr_sClass_SCREEN *o)
To enable clapack_dgesv, as shown:
info = clapack_dgesv(CblasRowMajor, 3, 1, term, 3, ipiv, d, 3);
This custom class compiles without error, using the following compile options:
~$ gcc -g -c $pwrp_appl/fuzzy.c -o $pwrp_obj/fuzzy.o -I$pwrp_inc -I$pwr_inc -I/usr/include/atlas -llapack_atlas -llapack -lblas -latlas -DOS_LINUX=1 -DOS=linux -DHW_X86=1 -DHW=x86 -DOS_POSIX
By copying libraries and include files to your directories, this condensed command works too:
gcc -g -c $pwrp_inc/fuzzy.c -o $pwrp_obj/fuzzy.o -I$pwr_inc -L$pwr_lib -DOS_LINUX=1 -DOS=linux -DHW_X86=1 -DHW=x86 -DOS_POSIX
When building a RootVolume Sim node, a link error occurs:
** Plc program link errors for x86_64_linux node plc_tester_0999_plc
/usr/local/pwrp/cpptest/bld/x86_64_linux/obj/fuzzy.o: In function 'SCREEN_exec':
/usr/local/pwrp/cpptest/bld/common/inc/fuzzy.c:1386: undefined reference to 'clapack_dgesv'
collect2: error: 1d returned 1 exit status
By manually adding library references to plc_tester_0999_plc.opt, the program above links successfully (despite the "Do no edit!" warning).
`: Autogenerated options file, Do not edit !!` $pwrp_obj/fuzzy.o $pwrb_root/os_linux/hw_x86_64/exp/obj/rt_io_user.o -lpwr_rt -lpwr_pnak_dummy -lpwr_cifx_dummy -lpwr_usb_dummy -lpwr_usbio_dummy -lpwr_nodave_dummy -lpwr_epl_dummy -llapack_atlas -latlas -lcblas -llapack -latlas
What script auto-generates this .opt file and how to add new library references?
Regards,
Ron