linux kernel compilation: ERROR: "function" [path/to/module/module.ko] undefined - compilation

I have a similar problem to this one, only for me it's an error not a warning. I'm building linux-4.8.5 with a patch applied to one module. I get:
ERROR: "intel_soc_pmic_readb" [drivers/gpu/drm/i915/i915.ko] undefined!
ERROR: "intel_soc_pmic_writeb" [drivers/gpu/drm/i915/i915.ko] undefined!
scripts/Makefile.modpost:91: recipe for target '__modpost' failed
make[1]: *** [__modpost] Error 1
Makefile:1201: recipe for target 'modules' failed
make: *** [modules] Error 2
In the other question they say something about KBUILD_EXTRA_SYMBOLS and documentation is supposed to be in Documentation/kbuild/modules.txt. But reading this file, this seems only to apply to modules not included in linux itself?
The functions are defined like
int function(){
do_stuff;
}
EXPORT_SYMBOL(function);
then there is the declaration
int function();
in a .h file in the include folder and it's called like
#include <the_aforementioned_file.h>
//stuff
function();
from a file in the same folder as the definition of the function. There are no other occurrences of the function name in the whole source tree.
And I really just don't see the mistake. Most likely I'm not looking in the right place, I guess.

As explained in a comment by Tsyvarev, this error is caused because the module in question is not being built, it requires the option CONFIG_INTEL_SOC_PMIC.

Related

Rnnlib installation range error

I am installing rnnlib through https://github.com/meierue/RNNLIB
After installing the boost and other and completing other steps I am getting the error- SeqBuffer.hpp:227: error: reference to ‘range’ is ambiguous
Helpers.hpp:298: error: candidates are: template<class T> std::pair<boost::iterators::counting_iterator<Incrementable, boost::iterators::use_default, boost::iterators::use_default>, boost::iterators::counting_iterator<Incrementable, boost::iterators::use_default, boost::iterators::use_default> > range(const T&, const T&)
Makefile:223: recipe for target 'DataExporter.o' failed
make[2]: *** [DataExporter.o] Error 1
make[2]: Leaving directory '/home/adminhp/Himaanshu/RNNLIB-master/src'
Makefile:217: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/adminhp/Himaanshu/RNNLIB-master'
Makefile:155: recipe for target 'all' failed
make: *** [all] Error 2
using namespace strikes again.
Helpers.hpp contains the following damning sequence:
using namespace std;
using namespace boost;
using namespace boost::assign;
using namespace boost::posix_time;
using namespace boost::gregorian;
Frankly, at this point I'd give up. Especially the first two lines are the moral equivalent of carpet bombing. With napalm.¹
UPDATE Created a pull request with the changes required to make the code compile.
To further compound the problem, RNNLIB's range facility is not even in a namespace...
So, the upshot is that range collides with the namespace from boost.
The simplest way to remove the clash is to qualify all the loopy uses of range as ::range...
PS. same comes up with equal later on
¹ Why is "using namespace std" considered bad practice?

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?

Veins file can't find other Veins file - no such file or directory

I want to use TraCIMobility.h from Veins to change some SUMO variables for visualization.
I receive an error, when building my project. TraCIMobility.h can't find BaseMobility.h, which is also part of Veins. Are there some problems inside the Veins project? I built it one more time, but it can't find its own modules. I added Veins to my project with Project->Properties->Project References.
This is the error:
10:12:16 **** Incremental Build of configuration gcc-debug for project CloudBasedCSW ****
make MODE=debug CONFIGNAME=gcc-debug all
cd src && make
make[1]: Entering directory `/c/work/Cloud_Curve_Speed_Warning/trunk/src/CloudBasedCSW/src'
visualization/Visualization.cc
In file included from ./visualization/Visualization.h:19:0,
from visualization/Visualization.cc:16:
C:/Tools/veins/src/veins-3.0/src/modules/mobility/traci /TraCIMobility.h:31:26: fatal error: BaseMobility.h: No such file or directory
make[1]: Leaving directory `/c/work/Cloud_Curve_Speed_Warning/trunk/src/CloudBasedCSW/src'
compilation terminated.
make[1]: *** [../out/gcc-debug/src/visualization/Visualization.o] Error 1
make: *** [all] Error 2
10:12:17 Build Finished (took 726ms)
This is the header, which includes TraCiMobility.h
#ifndef VISUALIZATION_H_
#define VISUALIZATION_H_
#include <omnetpp.h>
#include "modules/mobility/traci/TraCIMobility.h"
class Visualization: public cSimpleModule{
public:
Visualization();
virtual ~Visualization();
void initialize();
void handleMessage(cMessage *msg);
void setIce(std::string laneId);
void removeIce(std::string laneId);
};
#endif /* VISUALIZATION_H_ */
You didn't say which Veins version you are using, so I am assuming the newest, Veins 4a2. Here, you will need to specify the include path like so
#include "veins/modules/mobility/traci/TraCIMobility.h"
To clarify: the --meta:auto-include-path option to opp_makemake will always generate a -I include path that includes all of the missing components to make the include work (that is, writing as little as #include "traci/TraCIMobility.h" would yield a compiler flag of -I..../veins/src/veins/modules/mobility), but without adding a -I include path to the root of Veins, none of the includes within work. By specifying the full path to the file (relative to the source root of Veins), you are forcing opp_makemake to generate a -I include path of -I..../veins/src, which is what is needed to build Veins.

arch_vma_name undefined kernel module

I am getting following error when i try to insert a module
insmod: error inserting 'memory.ko': -1 Unknown symbol in module
Following happens when i make the module
make -C /lib/modules/2.6.32-279.19.1.el6.x86_64/build SUBDIRS=/work modules
make[1]: Entering directory `/usr/src/kernels/2.6.32-279.19.1.el6.x86_64'
Building modules, stage 2.
MODPOST 1 modules
WARNING: "arch_vma_name" [/work/memory.ko] undefined!
make[1]: Leaving directory `/usr/src/kernels/2.6.32-279.19.1.el6.x86_64'
You can see the reason of the error is arch_vma_name
Here is chunk of code where i used it
const char *name = arch_vma_name(vma);
I have included the header file
#include <linux/mm.h>
I am not able to understand the reason.

GHC :: Linking agains sqlite3 fails on Windows

I created simple application, which uses sqlite3 as it's datastore back-end. I faced no problems when building and running it on Linux, but after I tried to build it on Windows, I see weird linking error:
Linking dist\build\hnotes\hnotes.exe ...
C:\Documents and Settings\Admin\Application Data\cabal\sqlite-0.5.2.2\ghc-7.0.4/libHSsqlite-0.5.2.2.
a(sqlite3-local.o):sqlite3-local.c:(.text+0x21): undefined reference to `sqlite3_temp_directory'
C:\Documents and Settings\Admin\Application Data\cabal\sqlite-0.5.2.2\ghc-7.0.4/libHSsqlite-0.5.2.2.
a(sqlite3-local.o):sqlite3-local.c:(.text+0x40): undefined reference to `sqlite3_temp_directory'
collect2: v ld 1
cabal.EXE: Error: some packages failed to install:
hnotes-0.1 failed during the building phase. The exception was:
ExitFailure 1
What may be wrong there? I suspect that qalite3.dll has to be added to linking stage, but have no idea how to do that. Adding --extra-lib-dirs=path-to-sqlite-dll doesn't help either (perhaps because I need to update my cabal file somehow, to support this?).
Not sure if It's a bug or not, but the error comes from the sqlite3.h include of the sqlite package.
A look in the file shows this
/*
** CAPI3REF: Name Of The Folder Holding Temporary Files {H10310} <S20000>
**
** If this global variable is made to point to a string which is
** the name of a folder (a.k.a. directory), then all temporary files
** created by SQLite will be placed in that directory. If this variable
** is a NULL pointer, then SQLite performs a search for an appropriate
** temporary file directory.
**
** It is not safe to modify this variable once a [database connection]
** has been opened. It is intended that this variable be set once
** as part of process initialization and before any SQLite interface
** routines have been call and remain unchanged thereafter.
*/
SQLITE_EXTERN char *sqlite3_temp_directory;
so it's declared as an extern. So simple test:
module Main where
import Database.SQLite
main
= do hwd <- openConnection "test"
closeConnection hwd
putStrLn "done"
This crashes during linking as expected with the error you have above.
So I created a small C test file foo.c
#include "sqlite-0.5.2.2\\include\\sqlite3-local.h"
char* sqlite3_temp_directory = "C:\\test2";
So I'm defining a temp_directory and then I pass the c file along during compilation of the haskell source
$ ghc test.hs foo.c
[1 of 1] Compiling Main ( test.hs, test.o )
Linking test.exe ...
and then running it also returns the expected result
$ ./test
done
So it seems that you just need to give a value for the sqlite3_temp_directory, which if you set it to a NULL pointer will use the TMP/TEMP etc variables as defined in the SQLLITE manual.
edit, follow up on why it worked on Linux but not on windows
In the sqlite package, there's a file sqlite3.c under the folder sqlite3.6. This provides a bunch of defaults for the sqlite package.
when on linux OS_UNIX is defined and when on linux it uses the defines under OS_WIN.
The function we're interested in is the function which sets the temporary directory. for unix this'll be unixGetTempname and for windows winGetTempname.
If you look at the implementation of both these functions, for the unix one it has list of directories that it'll try
static const char *azDirs[] = {
0,
"/var/tmp",
"/usr/tmp",
"/tmp",
".",
};
it tries to access them in order and the one it can write to it uses to generate a temporary folder in.
For windows however one of the first lines are:
if( sqlite3_temp_directory ){
sqlite3_snprintf(MAX_PATH-30, zTempPath, "%s", sqlite3_temp_directory);
}else if( isNT() ){
so for windows sqlite3_temp_directory is actually used. This is why it doesn't compile if It can't find it.

Resources