Make error while ARM cross compiling an SQLite test fixture - linux

I am trying to create a testfixture for SQLite for ARM from a Linux pc. However, I am unable to compile as I am prompted with errors.
I get the following error,
Make: *** No rule to make target `armv7l-timesys-linux-gnueabi-gcc', \
needed by `testfixture'. Stop.
Below is the make file I am using.
#!/usr/make
#
# Makefile for SQLITE
#
# Source code to the test files.
#
# set up compiler and options
TOP = .
INCLUDES = -I"/home/bkrishnan/Downloads/sqlite-amalgamation/testfixture"
CC = armv7l-timesys-linux-gnueabi-gcc
CFLAGS = -g $(INCLUDES) -DSQLITE_PRIVATE="" -DSQLITE_TEST=1 -DTCLSH=1 -D_FILE_OFFSET_BITS=64 -DSQLITE_CORE
# library files.
LIB = libtcl8.5.so
#-----File Dependencies----------------------
# Source files.
SRC = \
$(TOP)/tclsqlite.c \
$(TOP)/sqlite3.c \
$(TOP)/shell.c
# Source OBJ files.
SRCOBJ = \
tclsqlite.o \
sqlite3.o \
shell.o
# Test source files.
TESTSRC = \
$(TOP)/test_async.c \
$(TOP)/test_autoext.c \
$(TOP)/test_backup.c \
$(TOP)/test_btree.c \
$(TOP)/test_config.c \
$(TOP)/test_demovfs.c \
$(TOP)/test_devsym.c \
$(TOP)/test_func.c \
$(TOP)/test_hexio.c \
$(TOP)/test_init.c \
$(TOP)/test_intarray.c \
$(TOP)/test_journal.c \
$(TOP)/test_malloc.c \
$(TOP)/test_mutex.c \
$(TOP)/test_onefile.c \
$(TOP)/test_osinst.c \
$(TOP)/test_pcache.c \
$(TOP)/test_schema.c \
$(TOP)/test_server.c \
$(TOP)/test_stat.c \
$(TOP)/test_tclvar.c \
$(TOP)/test_thread.c \
$(TOP)/test_vfs.c \
$(TOP)/test_wsd.c \
$(TOP)/test1.c \
$(TOP)/test2.c \
$(TOP)/test3.c \
$(TOP)/test4.c \
$(TOP)/test5.c \
$(TOP)/test6.c \
$(TOP)/test7.c \
$(TOP)/test8.c \
$(TOP)/test9.c \
$(TOP)/test_fuzzer.c \
$(TOP)/test_multiplex.c \
$(TOP)/test_quota.c \
$(TOP)/test_rtree.c \
$(TOP)/test_superlock.c \
$(TOP)/test_syscall.c \
$(TOP)/test_wholenumber.c \
$(TOP)/test_loadext.c \
$(TOP)/test_spellfix.c \
$(TOP)/test_vfstrace.c \
$(TOP)/fts3_term.c \
$(TOP)/fts3_test.c
# Test OBJ files
TESTOBJ = \
test_async.o \
test_autoext.o \
test_backup.o \
test_btree.o \
test_config.o \
test_demovfs.o \
test_devsym.o \
test_func.o \
test_hexio.o \
test_init.o \
test_intarray.o \
test_journal.o \
test_malloc.o \
test_mutex.o \
test_onefile.o \
test_osinst.o \
test_pcache.o \
test_schema.o \
test_server.o \
test_stat.o \
test_tclvar.o \
test_thread.o \
test_vfs.o \
test_wsd.o \
test1.o \
test2.o \
test3.o \
test4.o \
test5.o \
test6.o \
test7.o \
test8.o \
test9.o \
test_fuzzer.o \
test_multiplex.o \
test_quota.o \
test_rtree.o \
test_superlock.o \
test_syscall.o \
test_wholenumber.o \
test_loadext.o \
test_spellfix.o \
test_vfstrace.o \
fts3_term.o \
fts3_test.o
# Header files used by all library source files.
HDR = \
$(TOP)/sqlite3.h \
$(TOP)/btree.h \
$(TOP)/hash.h \
$(TOP)/hwtime.h \
$(TOP)/mutex.h \
$(TOP)/os.h \
$(TOP)/os_common.h \
$(TOP)/pager.h \
$(TOP)/pcache.h \
$(TOP)/sqlite3ext.h \
$(TOP)/sqliteLimit.h \
$(TOP)/sqliteInt.h \
$(TOP)/test_intarray.h \
$(TOP)/test_multiplex.h \
$(TOP)/test_quota.h \
$(TOP)/wal.h \
$(TOP)/vdbe.h \
$(TOP)/tcl.h \
$(TOP)/tclDecls.h \
$(TOP)/tclPlatDecls.h \
$(TOP)/tclTomMathDecls.h \
$(TOP)/tclTomMath.h \
$(TOP)/fts3Int.h
testfixture$(TEXE): $(CC) $(CFLAGS) -o $(SRCOBJ) $(TESTOBJ) $(HDR) -lm $(LIB)
#depend:
# makedepend -Y $(HDR)
clean:
rm -f $(TESTOBJ) $(SRCOBJ)

You should change
testfixture$(TEXE): $(CC) $(CFLAGS) -o $(SRCOBJ) $(TESTOBJ) $(HDR) -lm $(LIB)
to
testfixture$(TEXE): $(TESTOBJ)
$(CC) $(CFLAGS) -o $(SRCOBJ) $(TESTOBJ) $(HDR) -lm $(LIB)
because $(CC) is the command to run, not the target dependencies.

Related

How to cross-compile a rust application for ARM which uses Rocket web-server and requires nightly toolchain using Yocto?

I want to compile myRustApp which uses Rocket webserver in my meta layer. The issu I'm having is that openembedded does not support nightly release of Rust, which is required to run Rocket web-server.
The alternative was to use meta-rust, but it got me no where, because if I understand correctly the meta layer only supports native builds.
So I ended up using meta-rust-bin layer with pre-built nightly toolchain.
I was able to build nightly by executing ./build-new-version.sh nightly under meta-rust-bin.
After all this my recipe build by bitbake returns an Error:
WARNING: /home/jonas/project/sources/openembedded-core/meta/recipes-devtools/rust/rust-cross_1.59.0.bb: Exception during build_dependencies for TARGET_LLVM_FEATURES
WARNING: /home/jonas/project/sources/openembedded-core/meta/recipes-devtools/rust/rust-cross_1.59.0.bb: Error during finalise of /home/jonas/project/sources/openembedded-core/meta/recipes-devtools/rust/rust-cross_1.59.0.bb
ERROR: ExpansionError during parsing /home/jonas/project/sources/openembedded-core/meta/recipes-devtools/rust/rust-cross_1.59.0.bb
Traceback (most recent call last):
File "Var <TARGET_LLVM_FEATURES>", line 1, in <module>
File "/home/jonas/project/sources/openembedded-core/meta/recipes-devtools/rust/rust-common.inc", line 117, in llvm_features(d=<bb.data_smart.DataSmart object at 0x7fe03b341f60>):
return ','.join(llvm_features_from_tune(d) +
> llvm_features_from_cc_arch(d) +
llvm_features_from_target_fpu(d))
File "/home/jonas/project/sources/openembedded-core/meta/recipes-devtools/rust/rust-common.inc", line 36, in llvm_features_from_tune(d=<bb.data_smart.DataSmart object at 0x7fe03b341f60>):
> if target_is_armv7(d):
f.append('+v7')
bb.data_smart.ExpansionError: Failure expanding variable TARGET_LLVM_FEATURES, expression was ${#llvm_features(d)} which triggered exception NameError: name 'target_is_armv7' is not defined
The variable dependency chain for the failure is: TARGET_LLVM_FEATURES
ERROR: Parsing halted due to errors, see error messages above
WARNING: /home/jonas/project/sources/openembedded-core/meta/recipes-devtools/rust/rust-cross-canadian_1.59.0.bb: Exception during build_dependencies for TARGET_LLVM_FEATURES
WARNING: /home/jonas/project/sources/openembedded-core/meta/recipes-devtools/rust/rust-cross-canadian_1.59.0.bb: Error during finalise of /home/jonas/project/sources/openembedded-core/meta/recipes-devtools/rust/rust-cross-canadian_1.59.0.bb
My question is:
What causes this error I'm getting? How can I fix it?
Did someone already tried to cross-compile Rust nightly apps? Are there any examples anywhere?
My Cargo.toml:
[package]
name = "MyRustApp"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rocket = "0.4.10"
rocket_cors = "0.5.1"
serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"
[dependencies.rocket_contrib]
version = "0.4.10"
default-features = false
features = ["json"]
[profile.release]
strip = true
opt-level = "z"
lto = true
My recipe generated by cargo bitbake:
# Auto-Generated by cargo-bitbake 0.3.16
#
inherit cargo
# If this is git based prefer versioned ones if they exist
# DEFAULT_PREFERENCE = "-1"
# how to get strain-webserver could be as easy as but default to a git checkout:
# SRC_URI += "crate://crates.io/MyRustApp/0.1.0"
SRC_URI += "git://git#bitbucket.org/work/MyRustApp.git;protocol=ssh;nobranch=1;branch=main"
SRCREV = "xxx"
S = "${WORKDIR}/git"
CARGO_SRC_DIR = ""
PV:append = ".AUTOINC+d2562d3c92"
# please note if you have entries that do not begin with crate://
# you must change them to how that package can be fetched
SRC_URI += " \
crate://crates.io/aead/0.3.2 \
crate://crates.io/aes-gcm/0.8.0 \
crate://crates.io/aes-soft/0.6.4 \
crate://crates.io/aes/0.6.0 \
crate://crates.io/aesni/0.10.0 \
crate://crates.io/aho-corasick/0.7.20 \
crate://crates.io/atty/0.2.14 \
crate://crates.io/autocfg/1.1.0 \
crate://crates.io/base64/0.13.1 \
crate://crates.io/base64/0.9.3 \
crate://crates.io/bitflags/1.3.2 \
crate://crates.io/block-buffer/0.9.0 \
crate://crates.io/byteorder/1.4.3 \
crate://crates.io/cfg-if/0.1.10 \
crate://crates.io/cfg-if/1.0.0 \
crate://crates.io/cipher/0.2.5 \
crate://crates.io/cookie/0.11.5 \
crate://crates.io/cpufeatures/0.2.5 \
crate://crates.io/cpuid-bool/0.2.0 \
crate://crates.io/crypto-mac/0.10.1 \
crate://crates.io/ctr/0.6.0 \
crate://crates.io/devise/0.2.1 \
crate://crates.io/devise_codegen/0.2.1 \
crate://crates.io/devise_core/0.2.1 \
crate://crates.io/digest/0.9.0 \
crate://crates.io/filetime/0.2.18 \
crate://crates.io/form_urlencoded/1.1.0 \
crate://crates.io/fsevent-sys/2.0.1 \
crate://crates.io/fsevent/0.4.0 \
crate://crates.io/fuchsia-zircon-sys/0.3.3 \
crate://crates.io/fuchsia-zircon/0.3.3 \
crate://crates.io/generic-array/0.14.6 \
crate://crates.io/getrandom/0.2.8 \
crate://crates.io/ghash/0.3.1 \
crate://crates.io/glob/0.3.0 \
crate://crates.io/hashbrown/0.12.3 \
crate://crates.io/hermit-abi/0.1.19 \
crate://crates.io/hkdf/0.10.0 \
crate://crates.io/hmac/0.10.1 \
crate://crates.io/httparse/1.8.0 \
crate://crates.io/hyper/0.10.16 \
crate://crates.io/idna/0.1.5 \
crate://crates.io/idna/0.3.0 \
crate://crates.io/indexmap/1.9.2 \
crate://crates.io/inotify-sys/0.1.5 \
crate://crates.io/inotify/0.7.1 \
crate://crates.io/iovec/0.1.4 \
crate://crates.io/itoa/1.0.4 \
crate://crates.io/kernel32-sys/0.2.2 \
crate://crates.io/language-tags/0.2.2 \
crate://crates.io/lazycell/1.3.0 \
crate://crates.io/libc/0.2.137 \
crate://crates.io/log/0.3.9 \
crate://crates.io/log/0.4.17 \
crate://crates.io/matches/0.1.9 \
crate://crates.io/memchr/2.5.0 \
crate://crates.io/mime/0.2.6 \
crate://crates.io/mio-extras/2.0.6 \
crate://crates.io/mio/0.6.23 \
crate://crates.io/miow/0.2.2 \
crate://crates.io/net2/0.2.38 \
crate://crates.io/notify/4.0.17 \
crate://crates.io/num_cpus/1.14.0 \
crate://crates.io/opaque-debug/0.3.0 \
crate://crates.io/pear/0.1.5 \
crate://crates.io/pear_codegen/0.1.5 \
crate://crates.io/percent-encoding/1.0.1 \
crate://crates.io/percent-encoding/2.2.0 \
crate://crates.io/polyval/0.4.5 \
crate://crates.io/ppv-lite86/0.2.17 \
crate://crates.io/proc-macro2/0.4.30 \
crate://crates.io/proc-macro2/1.0.47 \
crate://crates.io/quote/0.6.13 \
crate://crates.io/quote/1.0.21 \
crate://crates.io/rand/0.8.5 \
crate://crates.io/rand_chacha/0.3.1 \
crate://crates.io/rand_core/0.6.4 \
crate://crates.io/redox_syscall/0.2.16 \
crate://crates.io/regex-syntax/0.6.28 \
crate://crates.io/regex/1.7.0 \
crate://crates.io/rocket/0.4.11 \
crate://crates.io/rocket_codegen/0.4.11 \
crate://crates.io/rocket_contrib/0.4.11 \
crate://crates.io/rocket_cors/0.5.2 \
crate://crates.io/rocket_http/0.4.11 \
crate://crates.io/ryu/1.0.11 \
crate://crates.io/safemem/0.3.3 \
crate://crates.io/same-file/1.0.6 \
crate://crates.io/serde/1.0.147 \
crate://crates.io/serde_derive/1.0.147 \
crate://crates.io/serde_json/1.0.89 \
crate://crates.io/sha2/0.9.9 \
crate://crates.io/slab/0.4.7 \
crate://crates.io/smallvec/1.10.0 \
crate://crates.io/state/0.4.2 \
crate://crates.io/subtle/2.4.1 \
crate://crates.io/syn/0.15.44 \
crate://crates.io/syn/1.0.103 \
crate://crates.io/time/0.1.44 \
crate://crates.io/tinyvec/1.6.0 \
crate://crates.io/tinyvec_macros/0.1.0 \
crate://crates.io/toml/0.4.10 \
crate://crates.io/traitobject/0.1.0 \
crate://crates.io/typeable/0.1.2 \
crate://crates.io/typenum/1.15.0 \
crate://crates.io/unicase/1.4.2 \
crate://crates.io/unicase/2.6.0 \
crate://crates.io/unicase_serde/0.1.0 \
crate://crates.io/unicode-bidi/0.3.8 \
crate://crates.io/unicode-ident/1.0.5 \
crate://crates.io/unicode-normalization/0.1.22 \
crate://crates.io/unicode-xid/0.1.0 \
crate://crates.io/universal-hash/0.4.1 \
crate://crates.io/url/1.7.2 \
crate://crates.io/url/2.3.1 \
crate://crates.io/version_check/0.1.5 \
crate://crates.io/version_check/0.9.4 \
crate://crates.io/walkdir/2.3.2 \
crate://crates.io/wasi/0.10.0+wasi-snapshot-preview1 \
crate://crates.io/wasi/0.11.0+wasi-snapshot-preview1 \
crate://crates.io/winapi-build/0.1.1 \
crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \
crate://crates.io/winapi-util/0.1.5 \
crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \
crate://crates.io/winapi/0.2.8 \
crate://crates.io/winapi/0.3.9 \
crate://crates.io/windows-sys/0.42.0 \
crate://crates.io/windows_aarch64_gnullvm/0.42.0 \
crate://crates.io/windows_aarch64_msvc/0.42.0 \
crate://crates.io/windows_i686_gnu/0.42.0 \
crate://crates.io/windows_i686_msvc/0.42.0 \
crate://crates.io/windows_x86_64_gnu/0.42.0 \
crate://crates.io/windows_x86_64_gnullvm/0.42.0 \
crate://crates.io/windows_x86_64_msvc/0.42.0 \
crate://crates.io/ws2_32-sys/0.2.1 \
crate://crates.io/yansi/0.5.1 \
"
# FIXME: update generateme with the real MD5 of the license file
LIC_FILES_CHKSUM = " \
"
SUMMARY = "Webserver with Rust"t"
LICENSE = "CLOSED"
# includes this file if it exists but does not fail
# this is useful for anything you may want to override from
# what cargo-bitbake generates.
include MyRustApp-${PV}.inc
include MyRustApp.inc

kubernetes config map - syntax error: unterminated quoted string

I am getting below error when trying to attach shell script as config map.
I am not sure what's the issue because script work without adding in config map
It shows error is on the line 58
Which is not even there.
Any help will be really appreciated.
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.metadata.name }}-micro
data:
micro-integrator.sh: |
#!/bin/sh
# micro-integrator.sh
while [ "$status" = "$START_EXIT_STATUS" ]
do
$JAVACMD \
-Xbootclasspath/a:"$CARBON_XBOOTCLASSPATH" \
$JVM_MEM_OPTS \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
$JAVA_OPTS \
-Dcom.sun.management.jmxremote \
-classpath "$CARBON_CLASSPATH" \
-Djava.io.tmpdir="$CARBON_HOME/tmp" \
-Dcatalina.base="$CARBON_HOME/wso2/lib/tomcat" \
-Dwso2.server.standalone=true \
-Dcarbon.registry.root=/ \
-Djava.command="$JAVACMD" \
-Dqpid.conf="/conf/advanced/" \
$JAVA_VER_BASED_OPTS \
-Dcarbon.home="$CARBON_HOME" \
-Dlogger.server.name="micro-integrator" \
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
-Dcarbon.config.dir.path="$CARBON_HOME/conf" \
-Dcarbon.repository.dir.path="$CARBON_HOME/repository" \
-Dcarbon.components.dir.path="$CARBON_HOME/wso2/components" \
-Dcarbon.dropins.dir.path="$CARBON_HOME/dropins" \
-Dcarbon.external.lib.dir.path="$CARBON_HOME/lib" \
-Dcarbon.patches.dir.path="$CARBON_HOME/patches" \
-Dcarbon.internal.lib.dir.path="$CARBON_HOME/wso2/lib" \
-Dcom.atomikos.icatch.hide_init_file_path=true \
-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false \
-Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
-Dcom.sun.jndi.ldap.connect.pool.authentication=simple \
-Dcom.sun.jndi.ldap.connect.pool.timeout=3000 \
-Dorg.terracotta.quartz.skipUpdateCheck=true \
-Djava.security.egd=file:/dev/./urandom \
-Dfile.encoding=UTF8 \
-Djava.net.preferIPv4Stack=true \
-DNonRegistryMode=true \
-DNonUserCoreMode=true \
-Dcom.ibm.cacheLocalHost=true \
-Dcarbon.use.registry.repo=false \
-DworkerNode=false \
-Dorg.apache.cxf.io.CachedOutputStream.Threshold=104857600 \
-DavoidConfigHashRead=true \
-Dproperties.file.path=default \
-DenableReadinessProbe=true \
-DenableManagementApi=true \
$NODE_PARAMS \
-Dorg.apache.activemq.SERIALIZABLE_PACKAGES="*" \
org.wso2.micro.integrator.bootstrap.Bootstrap $*
status="$?"
done

How to create user for connect to database

ERROR :
[FATAL] [DBT-05509] Failed to connect to the specified database (cdb21).
CAUSE: OS Authentication might be disabled for this database (cdb21).
ACTION: Specify a valid sysdba user name and password to connect to the database.
First step:
./runInstaller -silent -responseFile /scratch/app/user/product/21.0.0/dbhome_1/install/response/db_install.rsp \
oracle.install.option=INSTALL_DB_SWONLY \
UNIX_GROUP_NAME=oinstall \
ORACLE_BASE=/scratch/app/user \
INVENTORY_LOCATION=/scratch/app/oraInventory \
SELECTED_LANGUAGES=en \
oracle.install.db.InstallEdition=EE \
oracle.install.db.isCustomInstall=false \
oracle.install.db.OSDBA_GROUP=oinstall \
oracle.install.db.OSBACKUPDBA_GROUP=oinstall \
oracle.install.db.OSDGDBA_GROUP=oinstall \
oracle.install.db.OSKMDBA_GROUP=oinstall \
oracle.install.db.OSRACDBA_GROUP=oinstall \
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
DECLINE_SECURITY_UPDATES=true
Second step:
dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-gdbname cdb21 \
-sid cdb21 \
-responseFile NO_VALUE \
-characterSet AL32UTF8 \
-sysPassword Welcome1 \
-systemPassword Welcome1 \
-createAsContainerDatabase true \
-numberOfPDBs 1 \
-pdbName pdb21 \
-pdbAdminPassword Welcome1 \
-databaseType MULTIPURPOSE \
-memoryMgmtType auto_sga \
-totalMemory 4096 \
-storageType FS \
-datafileDestination /scratch/oradata/ \
-emConfiguration NONE \
-ignorePreReqs
Start The service using :
lsnrctl start
Then :
startup

How to create a static Qt application with protobuf files on Linux?

I want to build a static qt application. First of all I build qt static version on my linux machine. In the first time when I builded static application, I received errors because my qt can't link my application with some linux *.so librarys. I fixed it by using
unix{ QMAKE_LFLAGS += -static-libgcc -static-libstdc++ }
and my application now runs on every linux platform, intependetly from local linux libraris, it doesn't linking with local linux .so files. I want to do that think also with my protobuf files. I didn't found in internet how to do that. So I'm asking for help in here. I add pro file below.
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = EthernetAntCtrl_app
TEMPLATE = app
ROOT = ./..
DESTDIR = $$ROOT/bin
TMP_PRG_DIR = $$ROOT/tmp
MOC_DIR = $$TMP_PRG_DIR/$$TARGET/moc
OBJECTS_DIR = $$TMP_PRG_DIR/$$TARGET/obj
UI_DIR = $$TMP_PRG_DIR/$$TARGET/ui
RCC_DIR = $$TMP_PRG_DIR/$$TARGET/resources
PROTOBUF_DIR = /usr/local/include/google/protobuf
include($$ROOT/status_monitoring/status_monitoring.pri)
include($$ROOT/qt-propertybrowser/src/qtpropertybrowser.pri)
DEFINES += QT_DEPRECATED_WARNINGS
#-static-libprotobuf
unix{
QMAKE_LFLAGS += -static-libgcc -static-libstdc++
}
SOURCES += \
main.cpp \
mainwindow.cpp \
interconnect.cpp \
switch.cpp \
../Common/MyLog.cpp \
../DevMan/DevmanLibraryController/CmdBase.cpp \
../DevMan/DevmanLibraryController/DevmanLibraryController.cpp \
../DevMan/Common/Names/CommonNames.cpp \
../DevMan/Common/Names/SystemMessageNames.cpp \
../DevMan/DevmanLibraryController/ConnectMsgs/TcpConnectMessage.cpp \
../DevMan/DevmanLibraryController/ConnectMsgs/TcpDisconnectMessage.cpp \
../DevMan/DevmanLibraryController/InitDeviceManagerMsgs/ResultMessage.cpp \
Msgs/InitDeviceManager_AntCtrl.cpp \
textedit.cpp \
pushbutton.cpp \
controller.cpp \
Msgs/CustomNames.cpp \
Msgs/AntCntrlMessage.cpp \
button_style.cpp \
ClientParameterManager.cpp \
../DevMan/DevmanLibraryController/ConnectMsgs/UdpConnectMessage.cpp \
../DevMan/DevmanLibraryController/ConnectMsgs/UdpDisconnectMessage.cpp \
LedButton.cpp
HEADERS += \
switch.h \
mainwindow.h \
interconnect.h \
structureofpackets.h \
../Common/MacroDefines.h \
../Common/MyLog.h \
../DevMan/DevmanLibraryController/CmdBase.h \
../DevMan/DevmanLibraryController/DevmanLibraryController.h \
../DevMan/Common/Names/CommonNames.h \
../DevMan/Common/Names/SystemMessageNames.h \
../DevMan/DevmanLibraryController/ConnectMsgs/TcpConnectMessage.h \
../DevMan/DevmanLibraryController/ConnectMsgs/TcpDisconnectMessage.h \
../DevMan/DevmanLibraryController/InitDeviceManagerMsgs/ResultMessage.h \
Msgs/InitDeviceManager_AntCtrl.h \
textedit.h \
pushbutton.h \
controller.h \
Msgs/CustomNames.h \
Msgs/AntCntrlMessage.h \
button_style.h \
ClientParameterManager.h \
../DevMan/DevmanLibraryController/ConnectMsgs/UdpConnectMessage.h \
../DevMan/DevmanLibraryController/ConnectMsgs/UdpDisconnectMessage.h \
LedButton.h
FORMS += \
mainwindow.ui
defineTest(copyToDestdir) {
files = $$1
#copyToDestdir($$PWD/ClientGuiConfig.ini)

Error: undefined reference to NetCDF functions

Background
I'm working on compiling MCIP which mean Meteorology Chemistry Interface Processor in centos 5.9 system.
I use gcc -version 4.9 to implement the process.
Setting
Here is some configuration setting in ~/.bashrc:
export DIR=/disk2/hyf/lib ## All lib ar installed under this path
# NetCDF setting
export PATH="$DIR/netcdf/bin:$PATH"
export NETCDF="$DIR/netcdf"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NETCDF/lib
# IOAPI
export BIN=Linux2_x86_64gfort
export BASEDIR=/disk2/hyf/backup/software/ioapi
export PATH=$DIR/ioapi-3.1/bin:$PATH
export LD_LIBRARY_PATH=$DIR/ioapi-3.1/lib:$LD_LIBRARY_PATH
# Set M3LIB for the model
export M3LIB=/disk2/hyf/cmaq/CMAQv5.1/lib
I also do soft link for the CMAQ model as these:
ln -s $NETCDF $(M3LIB)/x86_64/gcc/netcdf
ln -s $IOAPI $(M3LIB)/x86_64/gcc/ioapi
Makefile
Here is some subroutine in the Makefile:
# Requirements: set M3LIB before running this script
.SUFFIXES:
.SUFFIXES: .o .f90 .F90
MODEL = mcip.exe
#...gfortran
FC = gfortran
NETCDF = $(M3LIB)/netcdf
IOAPI_ROOT = $(M3LIB)/ioapi
FFLAGS = -O3 -gdwarf-2 -gstrict-dwarf -I$(NETCDF)/include - I$(IOAPI_ROOT)/include \
-ffpe-trap='invalid','zero','overflow','underflow'
##FFLAGS = -g -O0 \
-ffpe-trap='invalid','zero','overflow','underflow' \
-I$(NETCDF)/include -I$(IOAPI_ROOT)/include
LIBS = -L$(IOAPI_ROOT)/lib -lioapi \
-L$(NETCDF)/lib -lnetcdf -lgomp
DEFS =
MODULES =\
const_mod.o \
const_pbl_mod.o \
coord_mod.o \
date_time_mod.o \
date_pack_mod.o \
files_mod.o \
groutcom_mod.o \
luvars_mod.o \
mcipparm_mod.o \
mcoutcom_mod.o \
mdoutcom_mod.o \
metinfo_mod.o \
metvars_mod.o \
vgrd_mod.o \
wrf_netcdf_mod.o \
xvars_mod.o \
sat2mcip_mod.o
OBJS =\
mcip.o \
alloc_ctm.o \
alloc_met.o \
alloc_x.o \
bcldprc_ak.o \
blddesc.o \
chkwpshdr.o \
chkwrfhdr.o \
close_files.o \
collapx.o \
comheader.o \
cori.o \
dealloc_ctm.o \
dealloc_met.o \
dealloc_x.o \
detangle_soil_px.o \
e_aerk.o \
dynflds.o \
getgist.o \
getluse.o \
getmet.o \
getpblht.o \
getsdt.o \
getversion.o \
graceful_stop.o \
gridout.o \
init_io.o \
init_met.o \
init_x.o \
julian.o \
layht.o \
ll2xy_lam.o \
.......
ERROR
The output after I make shows like:
make[1]: Entering directory `/disk2/hyf/cmaq/CMAQv5.1/scripts/mcip/src'
gfortran -g -O0 -gdwarf-2 -gstrict-dwarf \
-I/disk2/hyf/cmaq/CMAQv5.1/lib/x86_64/gcc/netcdf/include \
-I/disk2/hyf/cmaq/CMAQv5.1/lib/x86_64/gcc/ioapi/include -c const_mod.f90
......
chkwpshdr.o: In function `chkwpshdr_':
/disk2/hyf/cmaq/CMAQv5.1/scripts/mcip/src/chkwpshdr.f90:109: \
undefined reference to `__netcdf_MOD_nf90_get_att_one_fourbyteint'
(a lot of these code showing the same mistake 'undefined reference')
/disk2/hyf/cmaq/CMAQv5.1/lib/x86_64/gcc/ioapi/lib/libioapi.a(open3.o): In
function `open3_':
open3.F:(.text+0x1531): undefined reference to `ncclos_'
.........
I think the compiler may have some conflicts with the .F and .f90 files in some case. But I don't know why. The gcc andhas already successfully installed with $PATH defined.
I've faced the same problem, and I've got to solve it by adding -lnetcdff and -lnetcdf (in this order) to the LIBS option in the MCIP makefile. Make sure the NETCDF variable is pointing to the correct path where netcdf is installed in your system.

Resources