473,837 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

python-mcrypt install on Mac OSX

Hi,
I'm having a hard time getting python-mcrypt extension to build.
I installed libmcrypt with --prefix=/usr and I checked that the
library exists

-rwxr-xr-x 1 root wheel 352K Sep 19 16:53 /usr/lib/libmcrypt.
4.4.8.dylib*
lrwxr-xr-x 1 root wheel 21B Sep 19 16:53 /usr/lib/libmcrypt.
4.dylib@ -libmcrypt.4.4.8 .dylib
lrwxr-xr-x 1 root wheel 21B Sep 19 16:53 /usr/lib/
libmcrypt.dylib @ -libmcrypt.4.4.8 .dylib
-rwxr-xr-x 1 root wheel 801B Sep 19 16:53 /usr/lib/libmcrypt.la*

But this is the output from setting up python-mcrypt

# python setup.py build
running build
running build_ext
building 'mcrypt' extension
creating build
creating build/temp.macosx-10.3-fat-2.5
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -
fno-common -dynamic -DNDEBUG -g -O3 -DVERSION="1.1" -I/usr/include -I/
Library/Frameworks/Python.framewor k/Versions/2.5/include/python2.5 -c
mcrypt.c -o build/temp.macosx-10.3-fat-2.5/mcrypt.o
creating build/lib.macosx-10.3-fat-2.5
gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
-bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/
mcrypt.o -lmcrypt -o build/lib.macosx-10.3-fat-2.5/mcrypt.so
/usr/bin/ld: for architecture ppc
/usr/bin/ld: can't locate file for: -lmcrypt
collect2: ld returned 1 exit status
/usr/bin/ld: for architecture i386
/usr/bin/ld: can't locate file for: -lmcrypt
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccGRKjU2.out (No such file or
directory)
error: command 'gcc' failed with exit status 1
What am I missing here? I linked PHP with the same libmcrypt library
just fine. This is only happening for this extension only.

Would appreciate any help, thx

Ahmad Baitalmal
Sep 20 '07 #1
3 8774
Ahmad ㋡ Baitalmal schrieb:
Hi,
I'm having a hard time getting python-mcrypt extension to build.
I installed libmcrypt with --prefix=/usr and I checked that the library
exists

-rwxr-xr-x 1 root wheel 352K Sep 19 16:53
/usr/lib/libmcrypt.4.4.8 .dylib*
lrwxr-xr-x 1 root wheel 21B Sep 19 16:53
/usr/lib/libmcrypt.4.dyl ib@ -libmcrypt.4.4.8 .dylib
lrwxr-xr-x 1 root wheel 21B Sep 19 16:53
/usr/lib/libmcrypt.dylib @ -libmcrypt.4.4.8 .dylib
-rwxr-xr-x 1 root wheel 801B Sep 19 16:53 /usr/lib/libmcrypt.la*

But this is the output from setting up python-mcrypt

# python setup.py build
running build
running build_ext
building 'mcrypt' extension
creating build
creating build/temp.macosx-10.3-fat-2.5
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd
-fno-common -dynamic -DNDEBUG -g -O3 -DVERSION="1.1" -I/usr/include
-I/Library/Frameworks/Python.framewor k/Versions/2.5/include/python2.5 -c
mcrypt.c -o build/temp.macosx-10.3-fat-2.5/mcrypt.o
creating build/lib.macosx-10.3-fat-2.5
gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
-bundle -undefined dynamic_lookup
build/temp.macosx-10.3-fat-2.5/mcrypt.o -lmcrypt -o
build/lib.macosx-10.3-fat-2.5/mcrypt.so
/usr/bin/ld: for architecture ppc
/usr/bin/ld: can't locate file for: -lmcrypt
collect2: ld returned 1 exit status
/usr/bin/ld: for architecture i386
/usr/bin/ld: can't locate file for: -lmcrypt
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccGRKjU2.out (No such file or
directory)
error: command 'gcc' failed with exit status 1
What am I missing here? I linked PHP with the same libmcrypt library
just fine. This is only happening for this extension only.
Try setting the DYLD_LIBRARY_PA TH might help. Or altering the setup.py
to add -L/usr/lib.

Diez
Sep 20 '07 #2
On Sep 19, 2007, at 11:04 PM, Diez B. Roggisch wrote:
Ahmad ㋡ Baitalmal schrieb:
>Hi,
I'm having a hard time getting python-mcrypt extension to build.
I installed libmcrypt with --prefix=/usr and I checked that the
library
exists

-rwxr-xr-x 1 root wheel 352K Sep 19 16:53
/usr/lib/libmcrypt.4.4.8 .dylib*
lrwxr-xr-x 1 root wheel 21B Sep 19 16:53
/usr/lib/libmcrypt.4.dyl ib@ -libmcrypt.4.4.8 .dylib
lrwxr-xr-x 1 root wheel 21B Sep 19 16:53
/usr/lib/libmcrypt.dylib @ -libmcrypt.4.4.8 .dylib
-rwxr-xr-x 1 root wheel 801B Sep 19 16:53 /usr/lib/
libmcrypt.la *

But this is the output from setting up python-mcrypt

# python setup.py build
running build
running build_ext
building 'mcrypt' extension
creating build
creating build/temp.macosx-10.3-fat-2.5
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd
-fno-common -dynamic -DNDEBUG -g -O3 -DVERSION="1.1" -I/usr/include
-I/Library/Frameworks/Python.framewor k/Versions/2.5/include/
python2.5 -c
mcrypt.c -o build/temp.macosx-10.3-fat-2.5/mcrypt.o
creating build/lib.macosx-10.3-fat-2.5
gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
-bundle -undefined dynamic_lookup
build/temp.macosx-10.3-fat-2.5/mcrypt.o -lmcrypt -o
build/lib.macosx-10.3-fat-2.5/mcrypt.so
/usr/bin/ld: for architecture ppc
/usr/bin/ld: can't locate file for: -lmcrypt
collect2: ld returned 1 exit status
/usr/bin/ld: for architecture i386
/usr/bin/ld: can't locate file for: -lmcrypt
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccGRKjU2.out (No such file or
directory)
error: command 'gcc' failed with exit status 1
What am I missing here? I linked PHP with the same libmcrypt library
just fine. This is only happening for this extension only.

Try setting the DYLD_LIBRARY_PA TH might help. Or altering the setup.py
to add -L/usr/lib.

Diez
--
http://mail.python.org/mailman/listinfo/python-list
Nope, that didn't do it.
The first clue I got that something is wrong was that mcrypt.h could
not be found. Even though it exists in /usr/include. So I added the
include_dirs and library_dirs to setup.py
mcrypt=Extensio n(
"mcrypt",
sources=["mcrypt.c"],
include_dirs=['/usr/include'],
libraries=["mcrypt"],
library_dirs=["/usr/lib"],
define_macros=[("VERSION", '"%s"'%VERSI ON)]
)

setup(name="pyt hon-mcrypt",
version = VERSION,
description = "Python interface to mcrypt library",
author = "Gustavo Niemeyer",
author_email = "ni******@conec tiva.com",
license = "LGPL",
long_descriptio n = \
"""
Python interface to mcrypt library.
""",
ext_modules = [mcrypt],
)
I'm still getting the same output:
unning build
running build_ext
building 'mcrypt' extension
gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
-bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/
mcrypt.o -L/usr/lib -lmcrypt -o build/lib.macosx-10.3-fat-2.5/mcrypt.so
/usr/bin/ld: for architecture ppc
/usr/bin/ld: can't locate file for: -lmcrypt
collect2: ld returned 1 exit status
/usr/bin/ld: for architecture i386
/usr/bin/ld: can't locate file for: -lmcrypt
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccqN4eHR.out (No such file or
directory)
error: command 'gcc' failed with exit status 1
It makes no sense, so I went to another brand new mac, installed
XCode and Python 2.5 and libmcrypt-2.5.8. I got the same results. So
I'm at a loss, how can ld not see libmcrypt.

I'm digging into disutils.syscon fig to see what is the build
environment that disutils is using.
Does anyone know how to build an extension manually? without using
distutils. If I can get it to build outside of distutils I might be
able to figure out what need to be done.

Thx

Sep 20 '07 #3

On Sep 19, 2007, at 11:04 PM, Diez B. Roggisch wrote:
Ahmad ㋡ Baitalmal schrieb:
>Hi,
I'm having a hard time getting python-mcrypt extension to build.
I installed libmcrypt with --prefix=/usr and I checked that the
library
exists

-rwxr-xr-x 1 root wheel 352K Sep 19 16:53
/usr/lib/libmcrypt.4.4.8 .dylib*
lrwxr-xr-x 1 root wheel 21B Sep 19 16:53
/usr/lib/libmcrypt.4.dyl ib@ -libmcrypt.4.4.8 .dylib
lrwxr-xr-x 1 root wheel 21B Sep 19 16:53
/usr/lib/libmcrypt.dylib @ -libmcrypt.4.4.8 .dylib
-rwxr-xr-x 1 root wheel 801B Sep 19 16:53 /usr/lib/
libmcrypt.la *

But this is the output from setting up python-mcrypt

# python setup.py build
running build
running build_ext
building 'mcrypt' extension
creating build
creating build/temp.macosx-10.3-fat-2.5
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd
-fno-common -dynamic -DNDEBUG -g -O3 -DVERSION="1.1" -I/usr/include
-I/Library/Frameworks/Python.framewor k/Versions/2.5/include/
python2.5 -c
mcrypt.c -o build/temp.macosx-10.3-fat-2.5/mcrypt.o
creating build/lib.macosx-10.3-fat-2.5
gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
-bundle -undefined dynamic_lookup
build/temp.macosx-10.3-fat-2.5/mcrypt.o -lmcrypt -o
build/lib.macosx-10.3-fat-2.5/mcrypt.so
/usr/bin/ld: for architecture ppc
/usr/bin/ld: can't locate file for: -lmcrypt
collect2: ld returned 1 exit status
/usr/bin/ld: for architecture i386
/usr/bin/ld: can't locate file for: -lmcrypt
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccGRKjU2.out (No such file or
directory)
error: command 'gcc' failed with exit status 1
What am I missing here? I linked PHP with the same libmcrypt library
just fine. This is only happening for this extension only.

Try setting the DYLD_LIBRARY_PA TH might help. Or altering the setup.py
to add -L/usr/lib.

Diez
--
http://mail.python.org/mailman/listinfo/python-list
Ok, I got it to work, but it still makes no sense. I had to install
libmcrypt with --prefix=/usr/local.
If I do it with --prefix=/usr then for some reason ld won't find it
when building python-mcrypt.

Obviously I had to also change the include_dirs and library_dirs in
the setup.py file.
I thought I'd share that so hopefully someone can explain what that's
all about.

Thx
Sep 20 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
9693
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10583
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10638
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9419
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7009
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5679
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4481
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4056
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3128
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.