Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 84084 - Ebuild modification for sci-libs/torch on AMD64
Summary: Ebuild modification for sci-libs/torch on AMD64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High enhancement
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2005-03-04 05:48 UTC by Gordon Jahn
Modified: 2005-05-09 04:23 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Ebuild patch for Torch on amd64 (torch-amd64-patch,1.49 KB, patch)
2005-03-04 06:05 UTC, Gordon Jahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gordon Jahn 2005-03-04 05:48:12 UTC
Ebuild for torch is marked x86 only.

I'm evaluating this package at the moment on my amd64 workstation and have modified the ebuild so it builds, installs and can be linked against (and run, of course).

Reproducible: Always
Steps to Reproduce:
Can be reproduced by running "emerge torch" on an amd64 system.
Actual Results:  
Error on emerge is that package is masked.

Expected Results:  
The software should have built Torch for amd64 architecture.

The patch I used - which is probably really messy due to my poor understanding
of ebuilds at the moment was:

== Start of: diff -d /usr/portage/sci-libs/torch/torch-3.ebuild
/etc/portage/sci-libs/torch/torch-3.ebuild ==

14c14
< KEYWORDS="x86"
---
> KEYWORDS="x86 ~amd64"
27,31c27,43
<       sed -i \
<               -e "s:^PACKAGES.*:PACKAGES = ${torch_packages}:" \
<               -e "s:^DEBUG.*:DEBUG = ${shalldebug}:" \
<               -e "s:^CFLAGS_OPT_FLOAT.*:CFLAGS_OPT_FLOAT = -Wall ${CFLAGS}
-ffast-math -malign-double:" \
<               Makefile_options_Linux
---
>       if ( echo $KEYWORDS | grep -i amd64 ) then
>               sed -i \
>                       -e "s:^PACKAGES.*:PACKAGES = ${torch_packages}:" \
>                       -e "s:^DEBUG.*:DEBUG = ${shalldebug}:" \
>                       -e "s:^CFLAGS_OPT_FLOAT.*:CFLAGS_OPT_FLOAT = -Wall
${CFLAGS} -ffast-math" \
>                       Makefile_options_Linux
>               sed -i -e 's| -malign-double||' -e 's| -mcpu=i686||' -e
's|march=i686|march=k8|' config/Makefile_options_g++
>               sed -i -e 's| -malign-double||' -e 's| -mcpu=i686||' -e
's|march=i686|march=k8|' config/Makefile_options_Linux
>               sed -i -e 's| -malign-double||' -e 's| -mcpu=i686||' -e
's|march=i686|march=k8|' Makefile_options_Linux
>       else
>               sed -i \
>                       -e "s:^PACKAGES.*:PACKAGES = ${torch_packages}:" \
>                       -e "s:^DEBUG.*:DEBUG = ${shalldebug}:" \
>                       -e "s:^CFLAGS_OPT_FLOAT.*:CFLAGS_OPT_FLOAT = -Wall
${CFLAGS} -ffast-math -malign-double:" \
>                       Makefile_options_Linux
>
>       fi

== End of Patch ==

Moving the torch e-build to /etc/portage/sci-libs and applying this patch allows
the package to be built and installed.  As it's a first go I left it marked as
"~amd64" and not "amd64".

As you can see all it does is change the "-march" within the makefiles and
removes the "-mcpu" and "-malign-double" flags.

Torch then builds and installs.

PS: Let me know if this isn't where to submit these things - there are a couple
of other packages I'm working on here that I may submit if anyone's interested
(them being ghmm for Hidden Markov Modelling and xmlio which is a dependency for
ghmm).
Comment 1 Carsten Lohrke (RETIRED) gentoo-dev 2005-03-04 05:54:52 UTC
Gorden: Would you be so nice and _attach_ a unified diff, please!?
Comment 2 Gordon Jahn 2005-03-04 06:05:48 UTC
Created attachment 52647 [details, diff]
Ebuild patch for Torch on amd64

Thanks Carlo - that was what I needed to know (like I said - I've never tried
to submit things like this before).

I trust I've done this right then - I did:

diff -d -u /usr/portage/sci-libs/torch/torch-3.ebuild
/etc/portage/sci-libs/torch/torch-3.ebuild > torch-amd64-patch

...and have attached the resulting file.
Comment 3 Herbie Hopkins (RETIRED) gentoo-dev 2005-05-09 04:23:40 UTC
Cleaner patch applied, ~amd64 keyword added. Thanks!