由买买提看人间百态

topics

全部话题 - 话题: fpic
1 (共1页)
r*******n
发帖数: 3020
1
来自主题: Programming版 - Linux and Shared object
3.4. Creating a Shared Library
Creating a shared library is easy. First, create the object files that will
go into the shared library using the gcc -fPIC or -fpic flag. The -fPIC and
-fpic options enable ``position independent code'' generation, a requirement
for shared libraries; see below for the differences. You pass the soname
using the -Wl gcc option. The -Wl option passes options along to the linker
(in this case the -soname linker option) - the commas after -Wl are not a
typo, and you mus... 阅读全帖
w****r
发帖数: 245
2
大侠,分类都分好了,求神签
# Basic Materials, Agricultural Chemicals
AGU Agrium Inc.
AVD American Vanguard Corp.
CAGC China Agritech Inc.
CF CF Industries Holdings, Inc.
CGA China Green Agriculture, Inc.
CMP Compass Minerals International
COIN Converted Organics Inc.
IPI Intrepid Potash, Inc.
MON Monsanto Co.
MOS Mosaic Co.
NOEC New Oriental Energy & Chemical
POT Potas... 阅读全帖
l*******G
发帖数: 1191
3
just some speculations:
the libraries
libcurses.so libX11.so libXmu.so libXi.so libGL.so libGLU.so libglut.so
libglut.a
you have on your computer may have multiple versions. So different parts of
your code may be linked to different versions of the libs.
Make sure for each lib, you just consistently use the same version. Check
your LD_LIBRARY_PATH, (help http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html)
Some of the libs above may be soft or hard links to some files in your file
... 阅读全帖
W*****x
发帖数: 684
4
$ cd geoip-api-c-master
$ libtoolize
$ aclocal
$ autoconf
$ automake --add-missing
$./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
... 阅读全帖
t****g
发帖数: 1
5
来自主题: Programming版 - g++ problem!!!!
-G is used to generate shared object (check g++ manual for solaris, yes
they are different). It's for compatibility, you should use -shared.
Actually .c should be compiled to .o first, then link to .so. I think
-G is passed to linker in link stage; in compile stage, it actually
means -fPIC or something similar to generate relocatable objects.
So in linux you should use
g++ -fPIC -Ixxxx -Ixxxx source.c -o source.o
g++ -shared source.o -o dest.so
p******g
发帖数: 347
6
来自主题: Programming版 - 提问:Python 2.7.2 on a Mac with SSL
post some error logs plz.
normally it's due to the missing header or missing lib file. or wrongly
configured include path and/or ld_library_path.
mac is unix, python is more linux-friendly, meaning they may well have
different default search path. also python by default compile w/o -fPIC. SSL
lib may need -fPIC.
anyway some error logs will use useful to tell what's wrong.
t******g
发帖数: 372
7
来自主题: Statistics版 - 怎么在Centos上面安装R package?
于server local与否无关,或者至少给些error log 别人也好知道你尝试了啥,
S/W Requirements:
-----------------
MySQL client library ("libmysqlclient.so") and header files
(see www.mysql.com). For Linux/intel you may use the binary rpms
client+devel+shared, and make sure you also have the header files,
they are *NOT* included in the following
MySQL-client-4.1.7-1.i386.rpm
MySQL-shared-4.1.7-1.i386.rpm
but they are included in the latest 4.1.7 rpm versions.
The library libz. This is a stan... 阅读全帖
N***i
发帖数: 2063
8
Best-Rated Financial Stocks Updated June 23, 2010
http://www.nasd100.com/2010/06/bestrated-financial-stocks-updated-june-23-2010.html
Ranking | Company (Ticker) | Average Rating Value | Average Rating
1 IRSA Inversiones Representaciones (ADR) (NYSE:IRS) 1.00 Strong Buy
2 Primus Guaranty, Ltd. (NYSE:PRS) 1.00 Strong Buy
3 China Life Insurance Company Ltd. (ADR) (NYSE:LFC) 1.00 Strong Buy
4 National Bank of Greece (ADR) (NYSE:NBG) 1.00 Strong Buy
5 HDFC Bank Limited (ADR) (NYSE:HDB) 1.00 ... 阅读全帖
w***y
发帖数: 2537
9
来自主题: _pennystock版 - Events and ER for week August 2-6 (转载)
【 以下文字转载自 Stock 讨论区 】
发信人: ll111 (Stealth), 信区: Stock
标 题: Events and ER for week August 2-6
发信站: BBS 未名空间站 (Sun Aug 1 22:47:17 2010, 美东)
Monday, Aug. 2
10 a.m.: ISM Manufacturing index on business activity in July, released by
the Institute for Supply Management.
10:15 a.m. Federal Reserve Chairman Ben Bernanke speaking on "challenges for
the economy and state governments."
4 p.m. Treasury Secretary Timothy Geithner speaking on the next steps for
financial reform.
Tuesday, Aug. 3
8:30 a.m.: P... 阅读全帖
w****g
发帖数: 206
10
【 以下文字转载自 Programming 讨论区 】
发信人: wooing (woo), 信区: Programming
标 题: 求助:有用portland compiler 的么?
发信站: BBS 未名空间站 (Mon Nov 1 21:42:17 2010, 美东)
老板让我试着用portland的compiler build code,以前一直用intel的,这两个之间的
flag是怎么对应的啊?
CC=icc
CXX=icpc
LINK=icpc
AR="/usr/bin/ar cru"
RANLIB=/usr/bin/ranlib
DEPENDFLAG="-MM"
REL_FLAGS="-fPIC"
SO_LIBS=""
CPPFLAGS="-Wall"
OPT_CPPFLAGS="-O2 -DNDEBUG"
DBG_CPPFLAGS="-O0 -g -DDEBUG"
DO_64BITS=1
ARCH_DIR="$canonical_name_guess"
SYS_LIBS="-i-static"
;;
... 阅读全帖
w****g
发帖数: 206
11
做了以下修改,还是不工作,有牛人帮看看么?
CC=pgcc
CXX=pgCC
LINK=pgCC
AR="/usr/bin/ar cru"
RANLIB=/usr/bin/ranlib
# DEPENDFLAG="-MM"
DEPENDFLAG="-MM"
# REL_FLAGS="-fPIC"
REL_FLAGS=""
SO_LIBS=""
# CPPFLAGS="-Wall"
CPPFLAGS="Minform=warn"
# OPT_CPPFLAGS="-O3 -xW -DNDEBUG"
OPT_CPPFLAGS="-O3"
# DBG_CPPFLAGS="-O0 -g -DDEBUG"
DBG_CPPFLAGS="-O0"
DO_64BITS=1
ARCH_DIR="$canonical_name"
# SYS_LIBS="-i-static"
SYS_LIBS="-Bstatic"
;;
M*****8
发帖数: 17722
12
股票符号 日期 最后价 跌幅 百分比
AAR, 20110520, 24.4999, -0.1624, -0.7
AAUKY, 20110520, 23.8300, -0.0513, -0.2
AAWW, 20110520, 63.9700, -1.4313, -2.2
AAXJ, 20110520, 62.6625, -0.3633, -0.6
AB, 20110520, 21.5300, -0.0545, -0.3
ABAX, 20110520, 30.8500, -1.4335, -4.6
ABB, 20110520, 26.3200, -0.0229, -0.1
ABCO, 20110520, 50.9300, -0.4103, -0.8
ABFS, 20110520, 25.3500, -0.7916, -3.1
ABW-A, 20110520, 25.2... 阅读全帖
n**x
发帖数: 606
13
Russell 2000:
AAON
AAT
AATI
AAWW
ABAX
ABBC
ABCB
ABCD
ABCO
ABD
ABFS
ABG
ABM
ABMD
ABVT
ACAT
ACC
ACCL
ACET
ACHN
ACIW
ACLS
ACO
ACOM
ACOR
ACPW
ACTG
ACTV
ACUR
ACW
ACXM
ADC
ADPI
ADTN
ADVS
AEA
AEC
AEGR
AEIS
AEL
AEPI
AF
AFAM
AFCE
AFFX
AFFY
AFP
AFSI
AGII
AGM
AGX
AGYS
AH
AHC
AHS
AHT
AI
AIMC
AIN
AINV
AIQ
AIR
AIRM
AIS
AIT
AKR
AKRX
ALC
ALCO
ALE
ALG
ALGN
ALGT
ALIM
ALJ
ALK
ALKS
ALNC
ALNY
ALOG
ALSK
ALTE
ALTH
ALX
AM
AMAG
AMCC
AMED
AMKR
AMN
AMPE
AMRC
AMRI
AMRS
AMSC
AMSF
AMSG
AMSWA
AMWD
ANAC
ANAD
ANDE
ANEN
ANGO
ANH... 阅读全帖
S*A
发帖数: 7142
14
来自主题: Linux版 - .so 和 .a
不能,你要换编译参数才能产生 .so 或者 .dll 文件。
链接的时候要用 ’-shared‘, 编译的时候要用 ‘-fpic'
d*******0
发帖数: 113
15
日志如下:请达人不吝赐教!
谢谢!
* Installing *source* package 'glmnet' ...
This package requires a fortran 90 compiler. We assume
that your fortran 90 environment is set up appropriately.
Reference: Section on 'Using F95 code' in R-exts manual.
R configured for gfortran...
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gfortran -fdefault-real-8 -ffixed-form -fpic -g -O2 -c newermultGLMnet.f90 -
o newermultGLMnet.o
gfortran -shared -L/usr/local/lib64 -o glmnet.so newermultGLMn... 阅读全帖
c**t
发帖数: 2744
16
来自主题: Programming版 - Ask a g++ compilation qestion
It's "g++ -fPIC -shared ...".
-qmkshrobj is for AIX...

笞髦刑岬 】
w****g
发帖数: 206
17
来自主题: Programming版 - 求助:有用portland compiler 的么?
老板让我试着用portland的compiler build code,以前一直用intel的,这两个之间的
flag是怎么对应的啊?
CC=icc
CXX=icpc
LINK=icpc
AR="/usr/bin/ar cru"
RANLIB=/usr/bin/ranlib
DEPENDFLAG="-MM"
REL_FLAGS="-fPIC"
SO_LIBS=""
CPPFLAGS="-Wall"
OPT_CPPFLAGS="-O2 -DNDEBUG"
DBG_CPPFLAGS="-O0 -g -DDEBUG"
DO_64BITS=1
ARCH_DIR="$canonical_name_guess"
SYS_LIBS="-i-static"
;;
象以上这些,除了吧icc改成pgcc,icpc改成pgCC外,其他的怎么修改啊?
G*****9
发帖数: 3225
18
来自主题: Programming版 - Urgent question: AIX, C++11, Shared Object
I am using AIX. I cannot generate .so file
Code:
#include
using namespace std;
#ifdef __cplusplus
extern "C" { // only need to export C interface if
// used by C++ source code
#endif
bool Myfunction( );
#ifdef __cplusplus
}
#endif
bool Myfunction( )
{
std::uniform_real_distribution U(0.0, 1.0);
std::mt19937_64 rnd;
rnd.seed(1);
return true;
}
command: g++ -std=c++0x -maix64 -c -Wall -ansi -g -fPIC test.cc
Error:
test.cc: In function 'bool Myfunctio... 阅读全帖
w***g
发帖数: 5958
19
来自主题: Programming版 - Linux loading dynamic library problem
最好用static link. Linux版本太多, 如果想只deliver binary, 一要找一个老版本
的kernel, 二要static link所有的library. readline这种东西自己编译一个static版
本就可以了. 我最近在做的一个事情才扯淡. 对方要一个.so的binary. 但是
dependency一大堆, 结果是把所有要用到的library全都static link到这个.so中. 但
是这个.so本身又需要能被动态链接, 结果大部分的library还需要用-fPIC重新编译.
做完之后我很惊异于gnu这套toolchain的flexibility.
w***g
发帖数: 5958
20
开源的无所谓。如果你不想开源,或者客户没有下载源程序运行make的能力,那么我的
建议是centos 5.6,至少用vagrant之类的搞个centos 5.6做编译。这样基本上保证了
编译出来的二进制程序在哪儿都能跑。还有toolchain得花心思弄一下。网上可以弄到
gcc-4.7的yum respository,剩下各种自己依赖的library最好都用--enable-static -
-disable-shared外加export CFLAGS=-fPIC编译。这样可以弄出来静态编译的动态链接
库。很多环境,像java /python/matlab等和C++接口都需要你提供动态链接库,但是如
果你的动态链接库如果静态链接自带各种库的话能省很多事。不过Linux底下的静态链
接有一个问题,就是getaddrinfo/gethostbyname在静态链接的情况下没有解析域名的
能力,只能接受IP地址。如果程序需要域名解析,那libc还是只能动态链接。
新版本的ubuntu用户界面极其傻x。不过xubuntu挺不错。
我其实很惊异于我接触的那些公司(都有自己的机房)都还在用cento... 阅读全帖
i*o
发帖数: 149
21
来自主题: Unix版 - help on building shared object
To build a shared object( .so file),I used following commond:
gcc -fPIC -shared -o output.so input.c
and foo( ) is a function defined in input.c
In order to call foo, I did following in calling process:
void * handle = dlopen("output.so",RTLD_LAZY);
if((error=dlerror())!=NULL){
fputs(error,stderr);
exit(1);
}
foo = dlsym(handle,"foo");
foo()...
However, I got result:
./output.so: undefined symbol: foo
I am pretty sure the problem is from the shared object output.so which was not
T********r
发帖数: 6210
22
来自主题: Unix版 - help on building shared object
try this way:
gcc -fPIC -shared -o output.so input.c -ldl -lc
h**f
发帖数: 149
23
来自主题: Computation版 - 关于Matlab+CUDA问题求教
刚装上CUDA2.0 Toolkit 和 SDK,原来的问题解决了,但又有新问题
Cuda for Matlab 1.1
Matlab R2008A
Linux- Ubuntu 8.04
>> unix('make');
/usr/local/matlab/bin/mex CFLAGS='-fPIC -D_GNU_SOURCE -pthread -fexceptions'
COPTIMFLAGS='-O3 -funroll-loops -msse2' fft2_cuda.c \
-I/usr/local/cuda/include -L/usr/local/cuda/lib -lcufft -Wl,-rpath,/
usr/local/cuda/lib
Warning: You are using gcc version "4.2.3". The earliest gcc version
supported
with mex is "4.0.0". The latest version tested for use with mex is
"4.2.
1 (共1页)