crosscompile can't find header files for net-snmp (i686/mips64) - gcc

I'm currently trying to cross compile onto mips64 using a shared object library, when I run the following command:
toby#cbmFinal:~/x-tools/mips64-n64-linux-gnu/bin$ ./mips64-n64-linux-gnu-gcc -I /home/toby/Downloads/net-snmp-5.5.2.1/include/net-snmp/ -L /usr/lib64/libnetsnmp.so ~/BsDiagnostics/snmpdemoapp.c -o snmpdemoapp
It throws an error saying it can't find the header files:
/home/toby/BsDiagnostics/snmpdemoapp.c:1:38: error: net-snmp/net-snmp-config.h: No such file or directory
/home/toby/BsDiagnostics/snmpdemoapp.c:2:40: error: net-snmp/net-snmp-includes.h: No such file or directory
/home/toby/BsDiagnostics/snmpdemoapp.c: In function 'main':
/home/toby/BsDiagnostics/snmpdemoapp.c:14: error: 'netsnmp_session' undeclared (first use in this function)
/home/toby/BsDiagnostics/snmpdemoapp.c:14: error: (Each undeclared identifier is reported only once
/home/toby/BsDiagnostics/snmpdemoapp.c:14: error: for each function it appears in.)
/home/toby/BsDiagnostics/snmpdemoapp.c:14: error: expected ';' before 'session'
etc etc
I have checked the dir and they're all there, I can also do them each manually using -include but then have a bunch of other headers I can't all -include.
toby#cbmFinal:~/Downloads/net-snmp-5.5.2.1/include/net-snmp$ ls
agent definitions.h mib_api.h.gch output_api.h session_api.h.gch utilities.h
config_api.h library net-snmp-config.h pdu_api.h snmpv3_api.h varbind_api.h
config_api.h.gch machine net-snmp-config.h.in pdu_api.h.gch system varbind_api.h.gch
data_access mib_api.h net-snmp-includes.h session_api.h types.h version.h
Any help would be appreciated. Thanks!

Fixed, was a syntax error.
Correct command was:
toby#cbmFinal:~/x-tools/mips64-n64-linux-gnu/bin$ ./mips64-n64-linux-gnu-gcc -I/home/toby/Downloads/net-snmp-5.5.2.1/include/ -L/usr/lib64 -lnetsnmp ~/BsDiagnostics/snmpdemoapp.c -o snmpdemoapp

Related

error: linking with `ld` failed: exit status: 1

I'm trying to follow this guide as my entry into Solana blockchain development. I'm running into an error when I run the command $anchor build
For context, I'm running wsl. I'm not concerned about the warning, but any help would be much appreciated!
Here are the contents of the error:
error: linking with `ld` failed: exit status: 1
|
= note: "ld" "--version-script=/tmp/rustc7rlvlq/list" "--Bdynamic" "--entry=entrypoint" "--threads=1" "-z" "notext" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.0.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.1.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.10.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.11.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.12.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.13.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.14.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.15.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.2.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.3.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.4.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.5.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.6.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.7.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.8.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.9.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.23ok8bvhjt9fifog.rcgu.o" "--as-needed" "-L" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps" "-L" "/home/tai8910/Code/solana-twitter/target/release/deps" "-L" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib" "-Bstatic" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libanchor_lang-369f9fcce7f9778b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbase64-ee92f11b5395c52e.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsolana_program-9fe9cc99ff752644.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libserde_bytes-5207c42260a7c267.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libhex-6cd04f1b9c696e32.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsolana_frozen_abi-f9c2f8b8a627f8aa.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbs58-fe01222278a2eda8.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbv-c7c0e796134886cb.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/liblazy_static-809b40aac429888e.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libitertools-c458dae8c4611cd8.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libeither-6eeb62e68a9b8e57.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsha3-24b5c86da1eb0453.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libkeccak-ac25e9c6d97c1dff.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libthiserror-90c773aba6f68987.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsha2-48f21f103c901542.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libopaque_debug-7a932b68d3299c7b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libdigest-6389a1260a04b96b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libblock_buffer-a630a7b4c9084931.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libblock_padding-1a56ee8f16ee908c.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libgeneric_array-d7158a87da87264b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libtypenum-ef879e2476d2db6d.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/liblog-cc2d231fbaac5454.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libcfg_if-1643e4a2c6efb510.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libnum_traits-67afc00ec41f572f.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbincode-daf7bb0fce4a700c.rlib"
"/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libserde-e445d83f85708c13.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libborsh-701da45de74b9763.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbytemuck-eaed85aa73d5dfbc.rlib" "--start-group" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libstd-b9e47931bb048ddd.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libpanic_abort-cee38af281743742.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libstd_detect-4bf956fa4dfc36ef.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libhashbrown-419e08fa951207df.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/librustc_std_workspace_alloc-f389bcb5a4dc00c1.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libunwind-9d2b664eda1e59bf.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libcfg_if-0df5cdc1ad3f0480.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/liblibc-1d523315f98b1675.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/liballoc-38dcdcf486775e23.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/librustc_std_workspace_core-8201043866f2d4dd.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libcore-a4fd67b7f3cf9226.rlib" "--end-group" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libcompiler_builtins-fcfbbdc9d2a94cb9.rlib" "-Bdynamic" "--script" "/tmp/rustc7rlvlq/rustc-bpfel-linkfile.ld" "-znoexecstack" "-L" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib" "-o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.so" "--gc-sections" "-shared" "-O1"
= note: ld: unrecognized option '--threads=1'
ld: use the --help option for usage information
warning: `solana-twitter` (lib) generated 1 warning
error: could not compile `solana-twitter` due to previous error; 1 warning emitted
It looks like the build is not using the correct linker that's part of the BPF tool suite, probably using the default ld instead.
Can you make sure that ~/.local/share/solana/install/active_release/bin is part of your PATH? After that, try simply running cargo build-bpf to make sure that the program can build without Anchor. If it's still failing, you may need to reinstall the Solana tools.

How do I include mkl_vsl modules for random number generators e.g. 'vsrnggaussian'? (Fortran)

I'm new to Fortran (gfortran on windows) and want to use the random number generator vsrnggaussian.
vsrnggaussian needs the Intel MKL VSL modules 'mkl_vsl_type' and 'mkl_vsl' which are provided in the mkl_vsl.f90 file. This file needs to be included to generate the module files 'mkl_vsl_type.mod' and 'mkl_vsl.mod' which are used to process the Fortran use clauses referencing to the VSL interface:
use mkl_vsl_type
use mkl_vsl
I tried multiple things to include the mkl_vsl.f90 file but none of them work:
I inserted the file into the project directory --> 793 errors occured (can't list all of them here in detail) such as:
Unexpected data declaration statement at (1)
[...] at (1) has no implicit type
expecting [...] statement at (1)
unexpected [...] statement at (1)
and finally Fatal Error: Cannot open module file 'mkl_vsl_type.mod' for reading at (1): No such file or directory. compilation terminated. "gfortran -g -o incl_mkl.exe ../incl_mkl.f90" terminated with exit code 1. Build might be incomplete.
I used the full path in the include statement: INCLUDE 'C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2016.1.146/windows/mkl/include/mkl_vsl.f90' --> Error: Can't open included file
I tried the -Idir compiler command: gfortran -I/Program Files (x86)/IntelSWTools/compilers_and_libraries_2016.1.146/windows/mkl/include/ -g -o incl_mkl.exe --> gfortran: error: Files: no such file or directory
I put this into the makefile: INCLUDES=-I. -I/Program Files (x86)/IntelSWTools/compilers_and_libraries_2016.1.146/windows/mkl/include/ --> Error: Can't open included file
How do I include the mkl_vsl.f90 file??
edit: my simple code to include the mkl_vsl.f90 file
(this code will be compiled first before i compile my main code with vsrnggaussian):
Program INCL
IMPLICIT NONE
INCLUDE 'mkl_vsl.f90'
!INCLUDE 'C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2016.1.146/windows/mkl/include/mkl_vsl.f90'
END Program
You'd need to USE both vsl_type and vsl modules. The reason is that the derived types in vsl are defined in vsl_type. MWE
Program INCL
use mkl_vsl_type
use mkl
IMPLICIT NONE
write(6, *) 'hello world'
END Program
You would need to pass the address to file mkl_vsl.f90 to ifort and the mkl flag.
ifort -mkl foo.f90 <address>/mkl_vsl.f90
For using any specific subroutine of MKL consult their website. There is also extensive examples that come with MKL. You may find it in C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2016.1.146/windows/mkl/examples or something like that.

SynCrypto.pas and Lazarus compile problem

I'm trying to use SynCrypto.pas (part of Synopse mORMot ORM/SOA/MVC framework) in my Lazarus project to decrypt AES-128 stream. My project not compiling with errors in SynFPCTypInfo at this code:
PFPCInterfaceData = TypInfo.PInterfaceData;
PFPCVmtMethodParam = TypInfo.PVmtMethodParam;
PFPCIntfMethodTable = TypInfo.PIntfMethodTable;
PFPCIntfMethodEntry = TypInfo.PIntfMethodEntry;
SynFPCTypInfo.pas(91,31) Error: Identifier not found "PInterfaceData"
SynFPCTypInfo.pas(91,45) Error: Error in type definition
SynFPCTypInfo.pas(92,32) Error: Identifier not found "PVmtMethodParam"
SynFPCTypInfo.pas(92,47) Error: Error in type definition
SynFPCTypInfo.pas(93,33) Error: Identifier not found "PIntfMethodTable"
SynFPCTypInfo.pas(93,49) Error: Error in type definition
SynFPCTypInfo.pas(94,33) Error: Identifier not found "PIntfMethodEntry"
SynFPCTypInfo.pas(94,49) Error: Error in type definition
I think that it's incompatibility with Delphi TypInfo module. How can I fix it?
So ... I suggest you to install the new pascal: https://github.com/newpascal/newpascal/releases/tag/np-v1.0.56, download the zip and unzip it in some folder, for example (D: \ lazarus \ newpascal), and configure the paths according to the mORMot site: For proper FPC compilation, ensure you have the following settings to your project:
Other unit files (-Fu):
D:\lazarus\newpascal\ccr\mORMot;D:\lazarus\newpascal\ccr\mORMot\SQLite3;D:\lazarus\newpascal\ccr\mORMot\SQLite3\DDD\infra\
Include files (-Fi):
$(ProjOutDir);D:\lazarus\newpascal\ccr\mORMot;D:\lazarus\newpascal\ccr\mORMot\SQLite3\
Libraries (-fFl):
D:\lazarus\newpascal\ccr\mORMot\static$(TargetCPU)-$(TargetOS)\
site: https: //synopse.info/files/html/Synopse%20mORMot%20Framework%20SAD%201.18.html#TITL_113, then you will have at least how to test your app.

error: no member named 'emplace' , when compiling Liquibook using make all

In file included from ./Market.h:6:
In file included from
/Users/shubhamsharma/projects/liquibook/src/book/depth_order_book.h:6:
/Users/shubhamsharma/projects/liquibook/src/book/order_book.h:559:17:
error: no member named 'emplace' in
'std::__1::multimap<liquibook::book::ComparablePrice,
liquibook::book::OrderTracker<std::__1::shared_ptr<orderentry::Order> >,
std::__1::less<liquibook::book::ComparablePrice>, std::__1::allocator<std::__1::pair<const
liquibook::book::ComparablePrice, liquibook::book::OrderTracker<std::__1::shared_ptr<orderentry::Order> > > >
>'
stopBids_.emplace(key, std::move(tracker));
I have set all the environment variables, Makefile is generated using MPC, The error comes after make all. I have tried upgrading my gcc to 4.9 but still the same error occurs. Please help!

geoCouch install: compiling failed

I have trouble with including geoCouch to running couchDB (1.6.1).
I followed the Instruction: https://github.com/couchbase/geocouch/#for-apache-couchdb
In the GeoCouch directory ($HOME/geocouch) I tried to compile:
COUCH_SRC=$HOME/apache-couchdb-1.6.1/src/couchdb make couchdb
and get the message:
/rebar -C rebar_couchdb.config compile
==> vtree (compile)
Compiling /home/ec2-user/geocouch/vtree/src/vtree_cleanup.erl failed:
/home/ec2-user/geocouch/vtree/src/vtree_cleanup.erl:16: can't find include file "couch_db.hrl"
/home/ec2-user/geocouch/vtree/src/vtree_cleanup.erl:41: undefined macro 'LOG_DEBUG/2'
/home/ec2-user/geocouch/vtree/src/vtree_cleanup.erl:18: function cleanup/2 undefined
/home/ec2-user/geocouch/vtree/src/vtree_cleanup.erl:26: spec for undefined function vtree_cleanup:cleanup/2
/home/ec2-user/geocouch/vtree/src/vtree_cleanup.erl:47: function cleanup_multiple/3 is unused
/home/ec2-user/geocouch/vtree/src/vtree_cleanup.erl:54: function cleanup_nodes/2 is unused
/home/ec2-user/geocouch/vtree/src/vtree_cleanup.erl:62: function member_of_nodes/2 is unused
/home/ec2-user/geocouch/vtree/src/vtree_cleanup.erl:75: function partition_nodes/3 is unused
"couch_db.hrl" is located in /home/ec2-user/apache-couchdb-1.6.1/src/couchdb
Does anyone know how to fix that? Help/idea?

Resources