Gradle build error when installing stardist

I am trying to build QuPath to use the StarDist for segmentation. I carefully followed the step described in the instruction but still got error when running the command:

gradlew clean build createPackage -Ptensorflow-cpu-true

Here is the error message

I have set the environmet variables to point to the correct path of JDK . I have tried other commands and all worked.
I am using JDK14, any ideas?

Are you following the steps outlined in Building from source — QuPath 0.2.3 documentation ? I don’t see gradlew clean build createPackage -Ptensorflow-cpu-true in the steps outlined there. Maybe try gradlew clean build createPackage or gradlew createPackage -Ptype=installer if you want an installer? Or something could have broken during building, and gradlew clean should be used to reset it.

It’s these instructions:
https://qupath.readthedocs.io/en/0.2/docs/advanced/stardist.html?highlight=stardist#stardist

But I agree, that would be a good test to figure out what is going on.

Hi Mark, thanks for the reply. I tried both but none of them work :frowning:

Yes this is the instruction I followed, but still got the same error

Have you tried the commands suggested in the image you posted?

Yes, still no luck with that

What version of QuPath did you download?

EDIT: Try to download the repository after selecting the right tag (v0.2.3 in your case), then run the install command. Some changes in the main repository have been made in preparation for the next release.

2 Likes

Hi Melvin, thank you for the suggestion. I tried as you suggested but still failed with the same error message.

@Research_Associate @petebankhead

You haven’t yet reported any of the additional output, so there is very little to go off of other than “it isn’t working.” Which is not much to go off of.

Sorry for the confusion but everything I tried gave me the same error message, which is the ‘createPackage’ not found in root directory ‘qupath’

You may need to check Gradle then, at the website they suggested. I have not seen that error message before, and Google searches don’t come up with anything either. That suggest it is a setup issue specific to your system and not something to do with QuPath. Which is something of a cop-out, but I doubt there is much anyone can do from here if all of the debugging options do not produce additional information.

@HAOYANG_MI the explanation from @melvingelbard is correct: about a week ago I made some big changes to how the code is arranged in preparation for the next QuPath release, which means the instructions to build the code with TensorFlow temporarily don’t work.

We will update everything, but need a bit more time.

For now, there are two options if you want to build TensorFlow for QuPath v0.2.3.

1. Download the code for v0.2.3

Instead of using GitHub Desktop to get the latest code (as described in Step 2 here), download the code associated with v0.2.3 from the release page here and unzip it.

Then type the following at a command prompt

cd /path/to/code
./gradlew clean build createPackage -Ptensorflow-cpu=true

2. Switch to the v0.2.3 tag

If you have git installed in your computer, you can do everything at a command prompt

git clone https://github.com/qupath/qupath.git   
cd ./qupath  
git checkout tags/v0.2.3 -b v0.2.3-branch
./gradlew clean build createPackage -Ptensorflow-cpu=true

Important!

  1. On Windows, replace ./gradlew with gradlew
  2. You’ll need to use OpenJDK 14
  3. These steps are only for build TensorFlow with QuPath v0.2.3. Things will be different for QuPath v0.3.0 (and should hopefully be more straightforward).
5 Likes

This finally worked, thank you so much!

1 Like

Great! Which method did you use?

The second one, I installed git and did everything at command prompt.

1 Like