## Posts Tagged ‘nyu’

### Installing and running fmmlib from MATLAB on Mac OS X

Tuesday, December 26th, 2017

No better way to finish 2017 than trying to compile some old fortran code. This time it’s the fast multipole method library from nyu, fmmlib.

Here’s how I did it on a MacBook Pro running OS X 10.12 with MATLAB r2018a pre-release.

First install gfortran using homebrew via:

brew install gcc


Now we need to convince to use find and use gfortran.

and

In MATLAB issue:

copyfile('~/Downloads/xcode7_mexopts/gfortran.xml',fullfile( matlabroot, 'bin', 'maci64', 'mexopts' ))


On the command line, install gfortrani8 in the same directory as gfortran. I did this via:

cp ~/Downloads/gfortrani8 /usr/local/Cellar/gcc/7.2.0/bin/gfortrani8


Now, the following should succeed in MATLAB to setup the gfortran compiler:

mex -setup -v FORTRAN


For posterity: If you get “sdk” related issues, you may need to copy all the 10.13 lines in gfortran.xml and create analogous lines for 10.14 etc.

It seems like the '-compatibleArrayDims' flag should be used with fmmlib, but honestly I’m not sure. Something to revisit if it crashes on giant input I guess.

Finally, I had trouble locating the libgfortran.a library and convincing MATLAB’s Mex to use it. Therefore, I added:

[~,libgfortran] = system('gfortran -print-file-name=libgfortran.dylib');
libgfortran = libgfortran(1:end-1);


to my Mex script so that I can issue lines like this:

mex('fmm3d_r2012a.c',fortran_object_files{:},libgfortran);


This is enough to compile all of the fortran source files one by one and then link them during compilation and linking of the fmm3d_r2012a.c file.

I’ve added a matlab/compile.m script to my GitHub mirror/fork of the fmmlib library. So if you do the steps above you should be to just issue:

cd ~/Downloads
git clone
compile


Source

### BibTeX References

Tuesday, August 16th, 2011

I’m dumping BibTeX references for my publications in an html file on my academic site. The hope is to keep it up-to-date. And the real hope is to have to update it all the time ;-).

### ETH matlab license server, mac os x

Thursday, June 9th, 2011

I had already downloaded and installed MATLAB 2010b at NYU, so coming out here to ETH I didn’t want to bother reinstalling everything. I also didn’t want to have to VPN to NYU every time I wanted to use MATLAB. So instead I just switched my network license file to point to the ETH license server instead of the NYU one. This so far has worked out great. First thing I did was go the license directory in the matlab folder:

cd /Applications/MATLAB_R2010b.app/licenses/


Then I backed up my NYU license file:

mv network.lic network.lic.nyu


ETH license file, which is bizarrely named license.dat.mpg. Finally, I just moved this file to the proper place (current directory is the matlab license directory) with the proper name:

mv ~/Downloads/license.dat.mpg network.lic


### Bounded biharmonic weights project page

Wednesday, May 4th, 2011

My colleagues, Ilya Baran, Jovan Popović, Olga Sorkine, and I have just submitted the camera ready version of paper “Bounded Biharmonic Weights for Real-Time Deformation” to be presented at ACM SIGGRAPH 2011. I’ve put up a bounded biharmonic weights project page where you can find the preprint version of the article, videos and more to come.

Bounded biharmonic weights are featured in the official SIGGRAPH 2011 Technical Papers Advance Preview. The Technical Papers Chair, Hugues Hoppe, writes:

“An elegant UI framework that unifies cages, skeletons, and point constraints for 2D and 3D deformations.”

### Abstract

Object deformation with linear blending dominates practical use as the fastest approach for transforming raster images, vector graphics, geometric models and animated characters. Unfortunately, linear blending schemes for skeletons or cages are not always easy to use because they may require manual weight painting or modeling closed polyhedral envelopes around objects. Our goal is to make the design and control of deformations simpler by allowing the user to work freely with the most convenient combination of handle types. We develop linear blending weights that produce smooth and intuitive deformations for points, bones and cages of arbitrary topology. Our weights, called bounded biharmonic weights, minimize the Laplacian energy subject to bound constraints. Doing so spreads the influences of the controls in a shape-aware and localized manner, even for objects with complex and concave boundaries. The variational weight optimization also makes it possible to customize the weights so that they preserve the shape of specified essential object features. We demonstrate successful use of our blending weights for real-time deformation of 2D and 3D shapes.

Update: I have released a 2D matlab demo, with complete source code.

Sunday, July 18th, 2010

I have finally put up a separate academic site: http://cs.nyu.edu/~jacobson. There I’ll list publications, project pages, research interests and various work/school related addresses.

### Permissions for new folders on CIMS web pages

Friday, July 16th, 2010

This happens to me all the time working on my cims site. I’,m in public_html and I make a new directory, i.e.:


mkdir foo


Then I try to go to http://cs.nyu.edu/~[your name]/foo and I get:


Access forbidden ... Error 403


So I look at the permissions by issuing:


ls -l


And find that only I can read foo/:


...
...


Ok, so the default must be to have no read permissions, so naturally I always try:


chmod 604 foo/


Which also doesn’t work, I think because Apache needs the folder to have executable permissions. So finally the solution (also not hard to find on the cims help page is to issue:


chmod 705 foo/


Note: As a reminder here, you can set images/files/etc. to be readable on the web with:


chmod 604 file_name


### php on cims web site

Tuesday, March 30th, 2010

Cims has super funny permission settings on its public_html folders. I have a LaTeX in browser running there which is a very simple script. The real trouble was setting up the permissions.

Here’s the permissions of the containing folder, latex-in-browser/:


drwx---rwx   2 jacobson asj237        21 Mar 30 10:33 latex-in-browser


And of the relevant php files, latex-in-browser/index.php and latex-in-browser/typeset.php:


-rwx---r-x   1 jacobson asj237      4203 Feb  6 00:47 latex-in-browser/index.php
-rwx---r-x   1 jacobson asj237       795 Mar 30 10:33 latex-in-browser/typeset.php


Another thing that I found was the command in my typeset.php script:


$output=pdflatex -interaction nonstopmode -halt-on-error$texFile;


was not being executed. But when I did


which pdflatex


and found the full path to pdflatex. Then


$output=[insert/full/path/to]pdflatex -interaction nonstopmode -halt-on-error$texFile;


worked fine.

### “Recipe organizer and sharing interface”

Monday, January 4th, 2010

“Recipe organizer and sharing interface” is a recipe organizer and sharing web interface. It’s the Ruby on Rails app I wrote for my final class project in my senior year of college.

### Turn off rm, mv interactive prompting when ssh-ed into access.cims.nyu.edu

Wednesday, December 16th, 2009

When I ssh into access.cims.nyu.edu and issue a rm or mv command I am bombarded with prompts for every file. For example if I issue:

rm *.pdf

I have to type yes <ENTER> for every pdf in the current directory.

I have tried the -f option listed in the rm man page, but I’m still prompted. I wondered if there was a way to turn this prompting feature off. It would
be very convenient if rm-ing and mv-ing acted the same way in access.cims.nyu.edu as the other unix and linux machines I used, use and will use.

I emailed the Courant help desk and got a solution:

That’s because in the system-wide .bashrc, the mv, cp, and rm commands are aliased to “mv -i”, “cp -i”, and “rm -i”. To unalias these commands in your environment, you just need to add the following lines to the end of your ~/.bashrc.


unalias rm
unalias mv


I did just that and now everything works fine.

### Back up user directory using rsync over ssh as hourly cron job

Wednesday, November 18th, 2009

First I followed this blogger’s instructions to set up my ssh password so that my script wouldn’t have to prompt for a password. I tested this by sshing into my destination server (shouldn’t ask for password now). There I made a directory to put my backup:


mkdir ~/macbook-pro-backup


I don’t want to back up everything in my user directory so I made an exclude file at ~/.cims-exclude-list:


/ajx/Library
/ajx/Music
/ajx/Movies
/ajx/Pictures
/ajx/Documents/Parallels
/ajx/Desktop
/ajx/.Trash
*.mp3
.DS_Store


Then I constructed and tested my rsync command:


rsync -e ssh -avz --exclude-from ~/.cims-exclude-list ~ jacobson@access.cims.nyu.edu:macbook-pro-backup


Note: I have not used the --delete option because for now I have the space available on my destination server, but eventually I will probably have to start deleting older, no-longer-existent files.

After I used the above command to do the initial (big/long) transfer, knowing that it works I constructed this bash script to keep a nice log. I saved this in cims-backup.sh:


#!/bin/bash
touch ~/.cims-backup.log
if rsync -e ssh -az --exclude-from ~/.cims-exclude-list ~ \
jacobson@access.cims.nyu.edu:macbook-pro-backup
then
echo "Back up succeeded on $(date)" >> ~/.cims-backup.log else echo "Back up failed on$(date)" >> ~/.cims-backup.log
fi


Issue the following command to make this file executable


chmod -x cims-backup.sh


I ran this (bash cims-backup.sh) a couple times and checked the log file: cat ~/.cims-backup.log should produce something like


Back up succeeded on Wed Nov 18 16:23:49 EST 2009
Back up succeeded on Wed Nov 18 16:24:04 EST 2009


To be sure I sshed into my destination server and checked the macbook-pro-backup directory.

All that’s left is to set up an hourly cron job. To do this, in the terminal issue:


crontab -e


Then add this line and save:


0 * * * * /path/to/cims-backup.sh


If you are using vim to edit and you are getting this error:


crontab: temp file must be edited in place


then add this line to your .vimrc file:


set backupskip=/tmp/*,/private/tmp/*