Comments (20)
Thanks for pointing this out, it actually turned out to be a serious issue with an algorithm that dealt with intersections.
I pushed a fixed version, but not to master branch, but in a new branch called fix_intersections.
Please have a try, and let us know if you encounter trouble, it seems to work fine for me. Will merge to master after some testing.
To Chan: on my local machine, which doesn't have CGAL, the old intersectio method gives errors like 'index out of bounds', not urgent but worth having a look for the future.
from loom.
Hmm, it still seems broken for me: I just get a blank plot. I suppose it could be some misconfiguration on my machine (various packages have been updated since the last time I used loom). Here is terminal output:
andy@integrand:~/loom$ git co upstream/fix_intersection
Previous HEAD position was 3a0ca7f... add sage scripts for computation of discriminant and sheet tracking
HEAD is now at 504d854... minors
andy@integrand:~/loom$ python gmain.py
Use TkAgg backend for matplotlib.
SIGTERM catched by a child of loom.parallel.
SIGTERM catched by a child of loom.parallel.
Exception SIGTERM catched by a child of loom.parallel.
Exception SystemExit: Exception SystemExit: SystemExit('SIGTERM catched by a child of loom.parallel.',)SystemExit('SIGTERM catched by a child of loom.parallel.',) in in <Finalize object, dead><Finalize object, dead> ignored
ignored
SIGTERM catched by a child of loom.parallel.
SystemExit: SystemExit('SIGTERM catched by a child of loom.parallel.',) in <Finalize object, dead> ignored
Exception SystemExit: SystemExit('SIGTERM catched by a child of loom.parallel.',) in <Finalize object, dead> ignored
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1539, in __call__
return self.func(*args)
File "/home/andy/loom/loom/gui.py", line 480, in button_plot_action
logger_name=self.logger_name,
File "/home/andy/loom/loom/api.py", line 364, in make_spectral_network_plot
'@ theta = {}...'.format(spectral_network.phase))
AttributeError: 'NoneType' object has no attribute 'phase'
from loom.
Hi Andy, would you try web_ui
branch? This is the one that drives the web UI of loom
and is supposed to be stable albeit not up-to-date. I think that branch will be good enough for an A-type spectral network. If there is a problem using that branch please let me know because that should be readily fixed. I tried using GUI with the branch and generating spectral networks of the default configuration and it went well without a problem.
The real fix will come soon when I merge a few branches into the master and stabilize it.
from loom.
This kind of error
"AttributeError: 'NoneType' object has no attribute 'phase'"
is usually due to the fact that the network has not been produced.
It may indeed be an issue of configuration: I get something similar on my local machine, but not on the rutgers server.
The issue for my local machine is that it doesn't have a library called CGAL installed, so loom uses a different algorithm for computing intersections. This latter algorithm needs a fix (it's not the one I just fixed), it is not well-maintained at the moment.
Do you know if your machine has CGAL installed? You can tell e.g. by looking at the full output, if it is installed you should see lines such as:
"Use CGAL to find intersections."
Please let me know if you do have CGAL already installed (and loom is actually using it), because in that case it must be something else.
from loom.
Hi guys, same problem with web_ui branch. I'll try to get CGAL installed -- presumably that will fix my problem. Thanks for the pointers.
from loom.
Which version of CGAL do I need again? I hoped 4.7 would work (this isn't so hard to install) but it seems that it doesn't.
from loom.
The current version that I am using is CGAL
4.6.1. If there has been a change in the API of CGAL
4.7 then it may not work with loom
, so could you try installing 4.6.1 instead? Sorry about the inconvenience.
from loom.
Oops, I guess I was wrong, I actually DID install 4.6.1:
andy@integrand:~$ sudo apt-cache policy libcgal-dev
libcgal-dev:
Installed: 4.6.1-2ubuntu6
Candidate: 4.6.1-2ubuntu6
Version table:
*** 4.6.1-2ubuntu6 0
500 http://us.archive.ubuntu.com/ubuntu/ wily/universe amd64 Packages
100 /var/lib/dpkg/status
But when I run loom it says CGAL is not available. Is there something extra I have to do?
from loom.
Hmm... Now we're in a tricky situation. First of all, let me point out that the relevant part of the code is in SpectralNetwork.grow()
, starting from try:
.
Could you run
>>> platform.linux_distribution()
in the Python interpreter to see what it says?
And it would be also great if you can try compiling an example of CGAL and running it to see if the library is correctly installed, especially the following example.
http://doc.cgal.org/4.6.1/Sweep_line_2/Arrangement_on_surface_2_2sweep_line_8cpp-example.html
Probably I should put a small independent C++ code to check if the CGAL is correctly installed in the machine...
from loom.
Compiling sweep_line.cpp I get a lot of error output, beginning with:
/tmp/ccxEcDn5.o: In function `main':
sweep_line.cpp:(.text+0x465): undefined reference to `CGAL::assertion_fail(char const*, char const*, int, char const*)'
/tmp/ccxEcDn5.o: In function `CGAL::MP_Float::split(int, short&, short&)':
sweep_line.cpp:(.text._ZN4CGAL8MP_Float5splitEiRsS1_[_ZN4CGAL8MP_Float5splitEiRsS1_]+0x88): undefined reference to `CGAL::postcondition_fail(char const*, char const*, int, char const*)'
/tmp/ccxEcDn5.o: In function `CGAL::MP_Float::MP_Float()':
sweep_line.cpp:(.text._ZN4CGAL8MP_FloatC2Ev[_ZN4CGAL8MP_FloatC5Ev]+0x55): undefined reference to `CGAL::assertion_fail(char const*, char const*, int, char const*)'
sweep_line.cpp:(.text._ZN4CGAL8MP_FloatC2Ev[_ZN4CGAL8MP_FloatC5Ev]+0x88): undefined reference to `CGAL::assertion_fail(char const*, char const*, int, char const*)'
/tmp/ccxEcDn5.o: In function `CGAL::MP_Float::sign() const':
sweep_line.cpp:(.text._ZNK4CGAL8MP_Float4signEv[_ZNK4CGAL8MP_Float4signEv]+0x79): undefined reference to `CGAL::assertion_fail(char const*, char const*, int, char const*)'
/tmp/ccxEcDn5.o: In function `CGAL::operator*(CGAL::MP_Float const&, CGAL::MP_Float const&)':
sweep_line.cpp:(.text._ZN4CGALmlERKNS_8MP_FloatES2_[_ZN4CGALmlERKNS_8MP_FloatES2_]+0xd2): undefined reference to `CGAL::assertion_fail(char const*, char const*, int, char const*)'
/tmp/ccxEcDn5.o: In function `CGAL::to_double_exp(CGAL::MP_Float const&)':
sweep_line.cpp:(.text._ZN4CGAL13to_double_expERKNS_8MP_FloatE[_ZN4CGAL13to_double_expERKNS_8MP_FloatE]+0x1ab): undefined reference to `CGAL::assertion_fail(char const*, char const*, int, char const*)'
/tmp/ccxEcDn5.o:sweep_line.cpp:(.text._ZN4CGAL7Add_SubISt4plusIiEEENS_8MP_FloatERKS3_S5_RKT_[_ZN4CGAL7Add_SubISt4plusIiEEENS_8MP_FloatERKS3_S5_RKT_]+0x5a): more undefined references to `CGAL::assertion_fail(char const*, char const*, int, char const*)' follow
/tmp/ccxEcDn5.o: In function `CGAL::Arr_segment_traits_2<CGAL::Cartesian<CGAL::Quotient<CGAL::MP_Float> > >::_Segment_cached_2::_Segment_cached_2(CGAL::Point_2<CGAL::Cartesian<CGAL::Quotient<CGAL::MP_Float> > > const&, CGAL::Point_2<CGAL::Cartesian<CGAL::Quotient<CGAL::MP_Float> > > const&)':
sweep_line.cpp:(.text._ZN4CGAL20Arr_segment_traits_2INS_9CartesianINS_8QuotientINS_8MP_FloatEEEEEE17_Segment_cached_2C2ERKNS_7Point_2IS5_EESB_[_ZN4CGAL20Arr_segment_traits_2INS_9CartesianINS_8QuotientINS_8MP_FloatEEEEEE17_Segment_cached_2C5ERKNS_7Point_2IS5_EESB_]+0xdb): undefined reference to `CGAL::precondition_fail(char const*, char const*, int, char const*)'
from loom.
Oops I see, it works with -lCGAL, but then I get
andy@integrand:/tmp$ ./a.out
./a.out: error while loading shared libraries: libboost_thread.so.1.55.0: cannot open shared object file: No such file or directory
from loom.
Andy, did you compile the example according to the following instruction?
http://doc.cgal.org/4.6.1/Manual/installation.html#installation_configuring_using
The error complains about the lack of BOOST
library, which is a bit weird because I think Ubuntu should have checked the dependencies. Having said that, I didn't install CGAL
from the Ubuntu package but compiled it from the source code, following the instruction given at:
http://doc.cgal.org/4.6.1/Manual/installation.html
I think last time when we installed CGAL
on your laptop at Stony Brook we installed it from the source code and it worked fine, so I hope you can try doing that again.
from loom.
andy@integrand:~/loom$ python
Python 2.7.10 (default, Oct 14 2015, 16:09:02)
[GCC 5.2.1 20151010] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.linux_distribution()
('Ubuntu', '15.10', 'wily')
from loom.
Oh I see, no, I just compiled it by running g++ manually. OK, I'll try following these fancier instructions, but it might take some time before I get around to it. There are other people on the web who seem to have problems with libboost_thread; they post depressing remarks about how it took them a day to get it working.
from loom.
Probably you updated your Linux on the laptop with the up-to-date version? As far as I remember, when we installed CGAL
from the source code you made it work within a minute, so it was not a big deal then, but probably you've been using a different version of Ubuntu.
I am sort-of conservative when upgrading my Linux, and I am using 14.04 LTS, but probably that's not an option for you to fully utilize your laptop. Anyway, if I tell you my experience, the installation of CGAL from the source code was not particularly painful compared to other installations from source codes.
Seems that Python correctly returns the Linux distribution info, so the issue is likely to be the installation of CGAL
. I pushed a small test code in the web_ui
branch, which is basically the same as the sweep_line.cpp
code. Could you try the following?
$ cd loom/cgal_intersection
$ mkdir build
$ cd build
$ cmake ..
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Build type: Release
-- USING CXXFLAGS = ' -frounding-math -O3 -DNDEBUG'
-- USING EXEFLAGS = ' '
-- Targetting Unix Makefiles
-- Using /usr/bin/c++ compiler.
-- Requested component: MPFR
-- Requested component: GMP
-- Boost version: 1.54.0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/chan/loom/loom/cgal_intersection/build
$ make
Scanning dependencies of target cgal_intersection
[ 50%] Building CXX object CMakeFiles/cgal_intersection.dir/cgal_intersection.cpp.o
Linking CXX shared library libcgal_intersection.so
[ 50%] Built target cgal_intersection
Scanning dependencies of target cgal_test
[100%] Building CXX object CMakeFiles/cgal_test.dir/cgal_test.cpp.o
Linking CXX executable cgal_test
[100%] Built target cgal_test
$ ./cgal_test
Found 3 intersection points:
-21/-7 -21/-7
-3/-1 -5/-1
-35/-7 -35/-7
Found 10 interior-disjoint sub-segments.
where I also copy-and-pasted the output so that you can see what should be the correct output. If this fails on your machine then I suspect the installation of CGAL
is not correctly done, at least in the sense that loom
can utilize the library.
from loom.
It almost works but generates one extra message:
/usr/bin/ld: warning: libboost_thread.so.1.55.0, needed by /usr/local/lib/libCGAL.so, not found (try using -rpath or -rpath-link)
Looking around my filesystem it seems that I have libboost_thread.so.1.58.0
but not libboost_thread.so.1.55.0
, so I guess this must be the problem.
from loom.
I did a quick search on Google and indeed CGAL
is picky about the version of BOOST
, not really because it requires the version but rather it's more like a bug. If you don't mind, would you try installing the BOOST
library with version 1.55.0, like the error message suggests, or 1.54.0, which is the version I have on my Ubuntu?
from loom.
I'll try it -- but it'll take me a little while (it seems the repositories only have 1.58). Thanks for all your help with this hassle!
from loom.
OK, because I am lazy, I tried something brutal:
root@integrand:/usr/lib/x86_64-linux-gnu# ln -s libboost_thread.so.1.58.0 libboost_thread.so.1.55.0
This actually worked! So I'll close this. Thanks again for your help!
from loom.
Then indeed it's just a bug about checking the 'name' of the library, huh! Thanks for going through all the inconvenience and difficulty. Probably this is worth reporting to the CGAL
community.
from loom.
Related Issues (20)
- Implement a unit test HOT 2
- Strange failure when creating a large number of networks HOT 19
- save data with version info HOT 1
- Data saving doesn't work anymore HOT 26
- Intersection near a branch cut causes problems HOT 1
- Massless regular punctures
- Too many intersections reported HOT 5
- No log output in terminal HOT 7
- duplicate data structures? HOT 3
- Degenerate covers: sheet monodromy of higher-type ramification points of types II,III,IV HOT 1
- Keeping the interpolation intersection finding routine HOT 1
- Numerics of odeint HOT 1
- Rotation of z-plane should be somehow indicated in final output HOT 3
- Convention for \lambda_{SW} HOT 2
- specifying punctures like e^{2 pi i/3} HOT 6
- Lack of error message in web UI
- Occasional trivialization errors HOT 2
- "encountered a problem with sheet tracking" HOT 8
- sage bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loom.