List Info

Thread: Intel compilers to build Python?




Intel compilers to build Python?
user name
2006-08-27 22:44:04
I cannot get the Python package to build with the Intel
compiler. It  
does not find the _Py_Main symbol when linking the top-level
 
"python.exe".

What environment variables, configure arguments, and linker
tweaks  
are you all using to build Python on Macintosh with the
Intel compilers?



/usr/bin/install -c -d -m 755 Python.framework/Versions/2.4
icpc -dynamiclib -o Python.framework/Versions/2.4/Python
-dynamic   
libpython2.4.a \
          -lSystem -lSystemStubs -arch_only i386
-install_name /opt/ 
local/Library/Frameworks/Python.framework/Versions/2.4/Pytho
n - 
compatibility_version 2.4 -current_version 2.4
/usr/bin/install -c -d -m 755  \
        
Python.framework/Versions/2.4/Resources/English.lproj
/usr/bin/install -c -m 644
./Mac/OSXResources/framework/Info.plist \
         Python.framework/Versions/2.4/Resources/Info.plist
/usr/bin/install -c -m 644
./Mac/OSXResources/framework/version.plist \
        
Python.framework/Versions/2.4/Resources/version.plist
/usr/bin/install -c -m 644
./Mac/OSXResources/framework/English.lproj/ 
InfoPlist.strings \
        
Python.framework/Versions/2.4/Resources/English.lproj/ 
InfoPlist.strings
ln -fsn 2.4 Python.framework/Versions/Current
ln -fsn Versions/Current/Python Python.framework/Python
ln -fsn Versions/Current/Headers Python.framework/Headers
ln -fsn Versions/Current/Resources
Python.framework/Resources
icpc  -u _PyMac_Error Python.framework/Versions/2.4/Python
-undefined  
dynamic_lookup -o python.exe \
                 Modules/ccpython.o \
                  -ldl
case $MAKEFLAGS in \
*-s*) DYLD_FRAMEWORK_PATH=/opt/local/var/db/dports/build/ 
_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org
_dpupdate_dp 
orts_lang_python24/work/Python-2.4.3: CC='icc'
LDSHARED='icc  -bundle  
-undefined dynamic_lookup' OPT='-DNDEBUG -c99 -axT -O3
-parallel - 
fstack-security-check -fPIC -fno-common' ./python.exe -E
./setup.py - 
q build;; \
*) DYLD_FRAMEWORK_PATH=/opt/local/var/db/dports/build/ 
_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org
_dpupdate_dp 
orts_lang_python24/work/Python-2.4.3: CC='icc'
LDSHARED='icc  -bundle  
-undefined dynamic_lookup' OPT='-DNDEBUG -c99 -axT -O3
-parallel - 
fstack-security-check -fPIC -fno-common' ./python.exe -E
./setup.py  
build;; \
esac
dyld: lazy symbol binding failed: Symbol not found: _Py_Main
   Referenced from: /opt/local/var/db/dports/build/ 
_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org
_dpupdate_dp 
orts_lang_python24/work/Python-2.4.3/./python.exe
   Expected in: dynamic lookup

dyld: Symbol not found: _Py_Main
   Referenced from: /opt/local/var/db/dports/build/ 
_opt_local_var_db_dports_sources_rsync.rsync.darwinports.org
_dpupdate_dp 
orts_lang_python24/work/Python-2.4.3/./python.exe
   Expected in: dynamic lookup




Thanks!

- boyd

Boyd Waters
Scientific Programmer
National Radio Astronomy Observatory
Socorro, New Mexico
http://www.aoc.nrao.edu/

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIGpython.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
Intel compilers to build Python?
user name
2006-08-27 22:51:05
On 8/27/06, Boyd Waters <bwatersnrao.edu> wrote:
> I cannot get the Python package to build with the Intel
compiler. It
> does not find the _Py_Main symbol when linking the
top-level
> "python.exe".

Have you tried building it with just the source, not
DarwinPorts?

-bob
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIGpython.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
Intel compilers to build Python?
user name
2006-08-28 02:22:28
On Aug 27, 2006, at 4:51 PM, Bob Ippolito wrote:


> On 8/27/06, Boyd Waters <bwatersnrao.edu> wrote:
>
>> I cannot get the Python package to build with the
Intel compiler. It
>> does not find the _Py_Main symbol when linking the
top-level
>> "python.exe".
>>
>
> Have you tried building it with just the source, not
DarwinPorts?
>


Thanks for the quick reply, Bob.

Well, I'm the one who is hacking together the DarwinPort
for using  
the Intel compiler, as there are no such DarwinPorts in the
standard  
distribution. So no, it doesn't link without DP either.
libtool uses  
the wrong thing for linking, and so fails to find the Intel
libs:

libtool -o Python.framework/Versions/2.4/Python -dynamic   
libpython2.4.a \
          -lSystem -lSystemStubs -install_name
/Library/Frameworks/ 
Python.framework/Versions/2.4/Python -compatibility_version
2.4 - 
current_version 2.4
ld: for architecture i386
ld: Undefined symbols:
___intel_security_check_cookie
___intel_security_cookie
__intel_fast_memcpy
__intel_fast_memcmp
___libm_sse2_atan2
___libm_sse2_exp
___libm_sse2_log
___libm_sse2_sincos
___intel_cpu_indicator
___intel_cpu_indicator_init
__intel_fast_memset
___divdi3
libtool: internal link edit command failed


I have a patch that replaces "libtool" with
"icpc -dynamiclib", which  
seems to link, but perhaps that does the wrong thing?

If I do that manually, I get this error:

$ icpc -dynamiclib -o Python.framework/Versions/2.4/Python
-dynamic   
libpython2.4.a \
 >          -lSystem -lSystemStubs -arch_only i386
-install_name /opt/ 
local/Library/Frameworks/Python.framework/Versions/2.4/Pytho
n - 
compatibility_version 2.4 -current_version 2.4

$ make
icpc  -u _PyMac_Error Python.framework/Versions/2.4/Python
-o  
python.exe \
                 Modules/ccpython.o \
                  -ldl
ld: Undefined symbols:
_PyMac_Error
_Py_Main



- boyd

Boyd Waters
Scientific Programmer
National Radio Astronomy Observatory
Socorro, New Mexico
http://www.aoc.nrao.edu/



_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIGpython.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
Intel compilers to build Python?
user name
2006-08-29 02:28:34
On Aug 27, 2006, at 8:22 PM, Boyd Waters wrote:

> I'm the one who is hacking together the DarwinPort for
using the  
> Intel compiler

This is probably arrogance on my part. But I could not find
a recipe  
for building Python with the Intel compiler, so I created
one.

I have just finished building Python-2.5c1 (release
candidate 1) with  
the Intel compiler (9.1.029) on a Mac Pro. This might lead
to  
performance benefits with downstream plugins like NumPy, but
it is  
more likely to lead to compatibility issues with those
modules. I  
don't know yet.

Anyway, I patched two files: the configure shell script, and
the Mac/ 
PythonLauncher Makefile.in

	
The Mac/PythonLauncher/Makefile.in patch simply forces the
use of GCC  
to compile Objective-C files in the Mac Cocoa launcher.

The configure file slightly modifies the linking of
top-level python.exe

I applied the patches like this:

# cd Python-2.5c1
# patch -p0 < ~/Mac-PythonLauncher-Makefile.in.diff
# patch < ~/configure.diff


I invoked configure like this:

# CC=icc CXX=icpc OPT="-xT -O3 -fstack-security-check
-fpic - 
parallel" ICC_LIBS="-L/opt/intel/cc/9.1.029/lib
-lirc -limf" ./ 
configure --enable-framework

This tells the compiler to optimize for the Woodcrest or
Merom  
processor; to optimize for Core Solo/Duo, use -xP. I can
reliably  
trip a compiler error if I use -axT, which tries to
accommodate both  
types of processor.


I build like this:

# make -j4
# sudo make frameworkinstall


This goes rather quickly on a four-core Mac Pro. This
afternoon my  
colleagues came by to see what I was working on, gave me
encouraging  
comments like "Hey, you can get it to crash that much
faster on the  
new Mac..."


I'll have a DarwinPort real soon...

Feedback is welcome.

- boyd


_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIGpython.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
Intel compilers to build Python?
user name
2006-08-29 07:04:30
On 29-aug-2006, at 4:28, Boyd Waters wrote:

>
> Feedback is welcome.

How fast is your intel-compiled version of python compared
to a gcc- 
compiled one? Pystone is a good first approximation for
that.

Ronald

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIGpython.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )