Opened 11 years ago

Closed 11 years ago

#40003 closed defect (fixed)

wgrib2: build fails when nonexistent universal variant is selected

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: tenomoto (Takeshi Enomoto)
Priority: Normal Milestone:
Component: ports Version: 2.2.0
Keywords: haspatch Cc:
Port: wgrib2

Description

The wgrib2 port advertises no universal variant:

$ port variants wgrib2
wgrib2 has the variants:
   g95: build iplib with g95 (alpha)
     * conflicts with gcc44 gcc45 gcc46 gcc47 gcc48
   gcc44: build iplib with gcc44 (alpha)
     * conflicts with g95 gcc45 gcc46 gcc47 gcc48
   gcc45: build iplib with gcc45 (alpha)
     * conflicts with g95 gcc44 gcc46 gcc47 gcc48
   gcc46: build iplib with gcc46 (alpha)
     * conflicts with g95 gcc44 gcc45 gcc47 gcc48
   gcc47: build iplib with gcc47 (alpha)
     * conflicts with g95 gcc44 gcc45 gcc46 gcc48
   gcc48: build iplib with gcc48 (alpha)
     * conflicts with g95 gcc44 gcc45 gcc46 gcc47 gcc48

Nevertheless the port tries to build universal when I select the (nonexistent) universal variant, and then fails:

ld: warning: ignoring file /opt/local/var/macports/build/_Users_rschmidt_macports_dports_science_wgrib2/wgrib2/work/grib2/g2clib-1.4.0/libgrib2c.a, file was built for archive which is not the architecture being linked (x86_64): /opt/local/var/macports/build/_Users_rschmidt_macports_dports_science_wgrib2/wgrib2/work/grib2/g2clib-1.4.0/libgrib2c.a
Undefined symbols for architecture x86_64:
  "_dec_png", referenced from:
      _unpk_grib in unpk.o
  "_enc_jpeg2000", referenced from:
      _jpeg2000_grib_out in jpeg_pk.o
  "_g2_free", referenced from:
      _main in wgrib2.o
  "_g2_getfld", referenced from:
      _main in wgrib2.o
  "_g2_unpack3", referenced from:
      _f_gdt in GDT.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Either add a functional universal variant (perhaps with the help of the muniversal portgroup or patches to the build system) or remove the parts of the portfile that react to the universal variant selector. The attached patch does the latter (and also fixes a problem where the build wasn't using -arch flags when calling the linker).

Attachments (2)

main.log (147.0 KB) - added by ryandesign (Ryan Carsten Schmidt) 11 years ago.
wgrib2.diff (1.3 KB) - added by ryandesign (Ryan Carsten Schmidt) 11 years ago.
proposed patch

Download all attachments as: .zip

Change History (4)

Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.log added

Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: wgrib2.diff added

proposed patch

comment:1 Changed 11 years ago by tenomoto (Takeshi Enomoto)

universal variant was non-existent because of use_configure no. configure is set empty to avoid invoking a configure script, which does not exist. A link problem is resolved by ranlib libgrib2c.a. Committed in r109081.

comment:2 Changed 11 years ago by tenomoto (Takeshi Enomoto)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.