dgud / wings

Wings3D is an advanced sub-division 3D modeller.
http://www.wings3d.com
Other
572 stars 90 forks source link

Failure of make on final step of wings installation #576

Open KabirAgrawal opened 7 months ago

KabirAgrawal commented 7 months ago

Hi all!

I've been trying to install wings. I was following the steps starting with erlang, etc.

I run into the following error when executing make in the final step, this is my output:

`make TYPE=opt common make[1]: Entering directory '/home/kabir/wings' make --directory=c_src opt make[2]: Entering directory '/home/kabir/wings/c_src' make[2]: Nothing to be done for 'opt'. make[2]: Leaving directory '/home/kabir/wings/c_src' make --directory=intl_tools opt make[2]: Entering directory '/home/kabir/wings/intl_tools' make TYPE=opt common make[3]: Entering directory '/home/kabir/wings/intl_tools' make[3]: Nothing to be done for 'common'. make[3]: Leaving directory '/home/kabir/wings/intl_tools' make[2]: Leaving directory '/home/kabir/wings/intl_tools' make --directory=e3d opt make[2]: Entering directory '/home/kabir/wings/e3d' make TYPE=opt common make[3]: Entering directory '/home/kabir/wings/e3d' make[3]: Nothing to be done for 'common'. make[3]: Leaving directory '/home/kabir/wings/e3d' make[2]: Leaving directory '/home/kabir/wings/e3d' make --directory=src opt make[2]: Entering directory '/home/kabir/wings/src' make TYPE=opt common make[3]: Entering directory '/home/kabir/wings/src' erlc +nowarn_match_float_zero -Werror -I ../.. -I../_deps +debug_info -pa ../intl_tools -o../ebin wings_draw.erl wings_draw.erl:120:50: syntax error before: ')' % 120| proxy_data=wings_proxy:invalidate(Proxy, maybe), % | ^

wings_draw.erl:111:8: function prepare_fun2/3 undefined % 111| -> prepare_fun_2(D, We, Wes) % | ^

wings_draw.erl:113:11: function prepare_fun_2/3 undefined % 113| false -> prepare_fun_2(D, We, Wes) % | ^

make[3]: [Makefile:177: ../ebin/wings_draw.beam] Error 1 make[3]: Leaving directory '/home/kabir/wings/src' make[2]: [Makefile:157: opt] Error 2 make[2]: Leaving directory '/home/kabir/wings/src' make[1]: [Makefile:34: src] Error 2 make[1]: Leaving directory '/home/kabir/wings' make: [Makefile:27: opt] Error 2 `

I'm not sure what's going on here but any help would be great! I don't really know much about the Erlang syntax so I'm unaware of where to start around this issue. As far as I figured out, there's no parsing error so it might be something with function definition maybe? I have no idea.

Cheers, Kabir

dgud commented 7 months ago

That is really strange.

Which erlang version are you using?

KabirAgrawal commented 7 months ago

That was the version I was using. I'm using Ubuntu 20.04 LTS if that makes any difference.

Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 14.2.2

dgud commented 7 months ago

Ok the problem seems to be maybe which is a reserved word in ERLANG-27, but should not be a problem with ERLANG-26 (which contains emulator version 14.2.2).

  1. In Erlang-26 you need to turn on maybe-feature to make it a problem like yours, have you done that?
  2. how did you install erlang?
  3. Do you have any ERL_* environment flags?

Anyway you can solve this by single-quote the word maybe on wings_draw.erl:120:50 but it strange that the compiler is complaining about this.

dgud commented 7 months ago

This should be fixed in wings anyway to be able to work with ERLANG-27 which will be released in May or June.

KabirAgrawal commented 7 months ago

Ah I see. That's quite interesting.

  1. I don't believe I have.
  2. I installed it using the following commands

    git clone https://github.com/erlang/otp.git cd otp ./configure make make install

  3. Nope. I did have ERL_LIBS at one point but I unset it after I realised I didn't need it

I'll give that a crack and let you know. Would that also solve the other error that showed up regarding prepare_fun_2/3?

dgud commented 7 months ago
git clone https://github.com/erlang/otp.git
cd otp
./configure
make
make install

Ok that explains it :-) You get the master branch i.e. our current development branch which contains the work for ERLANG-27. Where maybe is a reserved word.

To get a stable version checkout the latest released with tag OTP-26.2 or from the maint branch.

Delete the previous installation:

git checkout OTP-26.2.2   (or just maint which contains unreleased bug fixes on 26) 
git clean -dfx
./configure
make
make install

That should be the proper way solve it, but if you want to live on the bleeding edge, try to fix the compilation problems you get with OTP-27 and send a PR here with your fixes.

I'll give that a crack and let you know. Would that also solve the other error that showed up regarding prepare_fun_2/3? Yes, that is a followup error that the previous function doesn't exist (since it couldn't compile).

KabirAgrawal commented 7 months ago

Huge!

Is there a safe way to uninstall Erlang/OTP from the way I did? I don't want to mess around with anything that could potentially stitch things up...

Also in light of this, is there sorta like, a guide as to what commands to run in order to complete a valid installation of Wings or Wings3D? I find myself running a bit all over the place to get the relevant information. E.g. first install erlang, then rebar3, etc. but then there's certain subtleties around which versions to install. (I'm really new when it comes to that stuff and I don't have a good enough understanding of it to follow installation procedures).

Thank you so much for all your help!!

dgud commented 7 months ago

Is there a safe way to uninstall Erlang/OTP from the way I did? I don't want to mess around with anything that could potentially stitch things up...

Not really (sorry), manually: Where I believe Default INSTALL_PATH is /usr/local/

(cd INSTALL_PATH/bin/; rm  ct_run  dialyzer  epmd  erl  erlc  escript  run_erl  to_erl  typer)
rm -rf INSTALL_PATH/lib/erlang

Also in light of this, is there sorta like, a guide as to what commands to run in order to complete a valid installation of Wings or Wings3D? I find myself running a bit all over the place to get the relevant information. E.g. first install erlang, then rebar3, etc. but then there's certain subtleties around which versions to install. (I'm really new when it comes to that stuff and I don't have a good enough understanding of it to follow installation procedures).

You have done great, except checking out a tagged (released) version of erlang.

Validation of wings, should be just to start it and play around with it :-)

erl -pa /path/to/wings/ebin -run wings_start

dgud commented 7 months ago

The hardest path is installing the needed Ubuntu packages which changes with each version of ubuntu, you seem to have done that otherwise the compilation should have more failures I think.

And OpenCL packages is hard to get working on linux in general, but that is optional (though better).

Micheus commented 7 months ago

@dgud, maybe the use of the pre-built version or Erlang can be a safe option (when available for targeted Ubuntu version). Can't it be? I used to check if there was one for mine. I just checked and there is one (26.2.1-1) for the Focal (20.04) at https://www.erlang-solutions.com/downloads/

dgud commented 7 months ago

Ubuntus default erlang installations are often a generation to old, so it is often easier to build it yourself. But yeah, erlang solutions provided ones can work as well if they exists.